MCPcopy Create free account
hub / github.com/cdgriffith/Box / to_msgpack

Method to_msgpack

box/box.py:1165–1173  ·  view source on GitHub ↗

Transform the Box object into a msgpack string. :param filename: File to write msgpack object too :param kwargs: parameters to pass to `msgpack.pack` :return: bytes of msgpack (if no filename provided)

(self, filename: str | PathLike | None = None, **kwargs)

Source from the content-addressed store, hash-verified

1163 if msgpack_available:
1164
1165 def to_msgpack(self, filename: str | PathLike | None = None, **kwargs):
1166 """
1167 Transform the Box object into a msgpack string.
1168
1169 :param filename: File to write msgpack object too
1170 :param kwargs: parameters to pass to `msgpack.pack`
1171 :return: bytes of msgpack (if no filename provided)
1172 """
1173 return _to_msgpack(self.to_dict(), filename=filename, **kwargs)
1174
1175 @classmethod
1176 def from_msgpack(

Callers 3

test_msgpack_stringsMethod · 0.95
test_msgpack_filesMethod · 0.95

Calls 3

to_dictMethod · 0.95
_to_msgpackFunction · 0.90
BoxErrorClass · 0.90

Tested by 3

test_msgpack_stringsMethod · 0.76
test_msgpack_filesMethod · 0.76