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)
| 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( |