# ormsgpack
![PyPI](https://img.shields.io/pypi/v/ormsgpack)
![PyPI - Downloads](https://img.shields.io/pypi/dm/ormsgpack)
ormsgpack is a fast msgpack serialization library for Python derived
from [orjson](https://github.com/ijl/orjson), with native support for
various Python types.
ormsgpack supports CPython 3.9, 3.10, 3.11, 3.12 and 3.13. Releases
follow semantic versioning and serializing a new object type without
an opt-in flag is considered a breaking change.
ormsgpack is licensed under both the Apache 2.0 and MIT licenses. The
repository and issue tracker is
[github.com/aviramha/ormsgpack](https://github.com/aviramha/ormsgpack), and patches may be
submitted there. There is a
[CHANGELOG](https://github.com/aviramha/ormsgpack/blob/master/CHANGELOG.md)
available in the repository.
1. [Usage](#usage)
1. [Install](#install)
2. [Quickstart](#quickstart)
4. [Serialize](#serialize)
1. [default](#default)
2. [option](#option)
5. [Deserialize](#deserialize)
2. [Types](#types)
1. [dataclass](#dataclass)
2. [datetime](#datetime)
3. [enum](#enum)
4. [float](#float)
5. [int](#int)
6. [numpy](#numpy)
7. [uuid](#uuid)
8. [pydantic](#pydantic)
3. [Latency](#latency)
4. [Questions](#questions)
5. [Packaging](#packaging)
6. [License](#license)
## Usage
### Install
To install a wheel from PyPI:
```sh
pip install --upgrade "pip>=20.3" # manylinux_x_y, universal2 wheel support
pip install --upgrade ormsgpack
```
To build a wheel, see [packaging](#packaging).
### Quickstart
This is an example of serializing, with options specified, and deserializing:
```python
>>> import ormsgpack, datetime, numpy
>>> data = {
... "type": "job",
... "created_at": datetime.datetime(1970, 1, 1),
... "status": "๐",
... "payload": numpy.array([[1, 2], [3, 4]]),
... }
>>> ormsgpack.packb(data, option=ormsgpack.OPT_NAIVE_UTC | ormsgpack.OPT_SERIALIZE_NUMPY)
b'\x84\xa4type\xa3job\xaacreated_at\xb91970-01-01T00:00:00+00:00\xa6status\xa4\xf0\x9f\x86\x97\xa7payload\x92\x92\x01\x02\x92\x03\x04'
>>> ormsgpack.unpackb(_)
{'type': 'job', 'created_at': '1970-01-01T00:00:00+00:00', 'status': '๐', 'payload': [[1, 2], [3, 4]]}
```
### Serialize
```python
def packb(
__obj: Any,
default: Optional[Callable[[Any], Any]] = ...,
option: Optional[int] = ...,
) -> bytes: ...
```
`packb()` serializes Python objects to msgpack.
It natively serializes
`bytes`, `str`, `dict`, `list`, `tuple`, `int`, `float`, `bool`,
`dataclasses.dataclass`, `typing.TypedDict`, `datetime.datetime`,
`datetime.date`, `datetime.time`, `uuid.UUID`, `numpy.ndarray`, and
`None` instances. It supports arbitrary types through `default`. It
serializes subclasses of `str`, `int`, `dict`, `list`,
`dataclasses.dataclass`, and `enum.Enum`. It does not serialize subclasses
of `tuple` to avoid serializing `namedtuple` objects as arrays. To avoid
serializing subclasses, specify the option `ormsgpack.OPT_PASSTHROUGH_SUBCLASS`.
The output is a `bytes` object.
The global interpreter lock (GIL) is held for the duration of the call.
It raises `MsgpackEncodeError` on an unsupported type. This exception message
describes the invalid object with the error message
`Type is not msgpack serializable: ...`. To fix this, specify
[default](#default).
It raises `MsgpackEncodeError` on a `str` that contains invalid UTF-8.
It raises `MsgpackEncodeError` if a `dict` has a key of a type other than `str` or `bytes`,
unless `OPT_NON_STR_KEYS` is specified.
It raises `MsgpackEncodeError` if the output of `default` recurses to handling by
`default` more than 254 levels deep.
It raises `MsgpackEncodeError` on circular references.
It raises `MsgpackEncodeError` if a `tzinfo` on a datetime object is
unsupported.
`MsgpackEncodeError` is a subclass of `TypeError`.
#### default
To serialize a subclass or arbitrary types, specify `default` as a
callable that returns a supported type. `default` may be a function,
lambda, or callable class instance. To specify that a type was not
handled by `default`, raise an exception such as `TypeError`.
```python
>>> import ormsgpack, decimal
>>> def default(obj):
... if isinstance(obj, decimal.Decimal):
... return str(obj)
... raise TypeError
...
>>> ormsgpack.packb(decimal.Decimal("0.0842389659712649442845"))
TypeError: Type is not msgpack serializable: decimal.Decimal
>>> ormsgpack.packb(decimal.Decimal("0.0842389659712649442845"), default=default)
b'\xb80.0842389659712649442845'
>>> ormsgpack.packb({1, 2}, default=default)
TypeError: Type is not msgpack serializable: set
```
The `default` callable may return an object that itself
must be handled by `default` up to 254 times before an exception
is raised.
It is important that `default` raise an exception if a type cannot be handled.
Python otherwise implicitly returns `None`, which appears to the caller
like a legitimate value and is serialized:
```python
>>> import ormsgpack, decimal
>>> def default(obj):
... if isinstance(obj, decimal.Decimal):
... return str(obj)
...
>>> ormsgpack.packb({"set":{1, 2}}, default=default)
b'\x81\xa3set\xc0'
>>> ormsgpack.unpackb(_)
{'set': None}
```
To serialize a type as a MessagePack extension type, return an
`ormsgpack.Ext` object. The instantiation arguments are an integer in
the range `[0, 127]` and a `bytes` object, defining the type and
value, respectively.
```python
>>> import ormsgpack, decimal
>>> def default(obj):
... if isinstance(obj, decimal.Decimal):
... return ormsgpack.Ext(0, str(obj).encode())
... raise TypeError
...
>>> ormsgpack.packb(decimal.Decimal("0.0842389659712649442845"), default=default)
b'\xc7\x18\x000.0842389659712649442845'
```
#### option
To modify how data is serialized, specify `option`. Each `option` is an integer
constant in `ormsgpack`. To specify multiple options, mask them together, e.g.,
`option=ormsgpack.OPT_NON_STR_KEYS | ormsgpack.OPT_NAIVE_UTC`.
##### OPT_NAIVE_UTC
Serialize `datetime.datetime` objects without a `tzinfo` and `numpy.datetime64`
objects as UTC. This has no effect on `datetime.datetime` objects that have
`tzinfo` set.
```python
>>> import ormsgpack, datetime
>>> ormsgpack.packb(
... datetime.datetime(1970, 1, 1, 0, 0, 0),
... )
b'\xb31970-01-01T00:00:00'
>>> ormsgpack.unpackb(_)
'1970-01-01T00:00:00'
>>> ormsgpack.packb(
... datetime.datetime(1970, 1, 1, 0, 0, 0),
... option=ormsgpack.OPT_NAIVE_UTC,
... )
b'\xb91970-01-01T00:00:00+00:00'
>>> ormsgpack.unpackb(_)
'1970-01-01T00:00:00+00:00'
```
##### OPT_NON_STR_KEYS
Serialize `dict` keys of type other than `str`. This allows `dict` keys
to be one of `str`, `int`, `float`, `bool`, `None`, `datetime.datetime`,
`datetime.date`, `datetime.time`, `enum.Enum`, and `uuid.UUID`.
```python
>>> import ormsgpack, datetime, uuid
>>> ormsgpack.packb(
... {uuid.UUID("7202d115-7ff3-4c81-a7c1-2a1f067b1ece"): [1, 2, 3]},
... option=ormsgpack.OPT_NON_STR_KEYS,
... )
b'\x81\xd9$7202d115-7ff3-4c81-a7c1-2a1f067b1ece\x93\x01\x02\x03'
>>> ormsgpack.unpackb(_)
{'7202d115-7ff3-4c81-a7c1-2a1f067b1ece': [1, 2, 3]}
>>> ormsgpack.packb(
... {datetime.datetime(1970, 1, 1, 0, 0, 0): [1, 2, 3]},
... option=ormsgpack.OPT_NON_STR_KEYS | ormsgpack.OPT_NAIVE_UTC,
... )
b'\x81\xb91970-01-01T00:00:00+00:00\x93\x01\x02\x03'
>>> ormsgpack.unpackb(_)
{'1970-01-01T00:00:00+00:00': [1, 2, 3]}
```
These types are generally serialized how they would be as
values, e.g., `datetime.datetime` is still an RFC 3339 string and respects
options affecting it.
This option has the risk of creating duplicate keys. This is because non-`str`
objects may serialize to the same `str` as an existing key, e.g.,
`{"1970-01-01T00:00:00+00:00": true, datetime.datetime(1970, 1, 1, 0, 0, 0): false}`.
The last key to be inserted to the `dict` will be serialized last and a msgpack deserializer will presumably take the last
occurrence of a key (in the above, `false`). The first value will be lost.
This option is not compatible with `ormsgpack.OPT_SORT_KEYS`.
##### OPT_OMIT_MICROSECONDS
Do not serialize the microsecond component of `datetime.datetime`,
`datetime.time` and `numpy.datetime64` instances.
```python
>>> import ormsgpack, datetime
>>> ormsgpack.packb(
... datetime.datetime(1970, 1, 1, 0, 0, 0, 1),
... )
b'\xba1970-01-01T00:00:00.000001'
>>> ormsgpack.unpackb(_)
'1970-01-01T00:00:00.000001'
>>> ormsgpack.packb(
... datetime.datetime(1970, 1, 1, 0, 0, 0, 1),
... option=ormsgpack.OPT_OMIT_MICROSECONDS,
... )
b'\xb31970-01-01T00:00:00'
>>> ormsgpack.unpackb(_)
'1970-01-01T00:00:00'
```
##### OPT_PASSTHROUGH_BIG_INT
Enables passthrough of big (Python) ints. By setting this option, one can set a `default` function for ints larger than 63 bits, smaller ints are still serialized efficiently.
```python
>>> import ormsgpack
>>> ormsgpack.packb(
... 2**65,
... )
TypeError: Integer exceeds 64-bit range
>>> ormsgpack.packb(
... 2**65,
... option=ormsgpack.OPT_PASSTHROUGH_BIG_INT,
... default=lambda _: {"type": "bigint", "value": str(_) }
... )
b'\x82\xa4type\xa6bigint\xa5value\xb436893488147419103232'
>>> ormsgpack.unpackb(_)
{'type': 'bigint', 'value': '36893488147419103232'}
```
##### OPT_PASSTHROUGH_DATACLASS
Passthrough `dataclasses.dataclass` instances to `default`. This allows
customizing their output but is much slower.
```python
>>> import ormsgpack, dataclasses
>>> @dataclasses.dataclass
... class User:
... id: str
... name: str
... password: str
...
>>> def default(obj):
... if isinstance(obj, User):
... return {"id": obj.id, "name": obj.name}
... raise TypeError
...
>>> ormsgpack.packb(User("3b1", "asd", "zxc"))
b'\x83\xa2id\xa33b1\xa4name\xa3asd\xa8password\xa3zxc'
>>> ormsgpack.packb(User("3b1", "asd", "zxc"), option=ormsgpack.OPT_PASSTHROUGH_DATACLASS)
TypeError: Type is not msgpack serializable: User
>>> ormsgpack.packb(
... User("3b1", "asd", "zxc"),
... option=ormsgpack.OPT_PASSTHROUGH_DATACLASS,
... default=default,
... )
b'\x82\xa2id\xa33b1\xa4name\xa3asd'
```
##### OPT_PASSTHROUGH_DATETIME
Passthrough `datetime.datetime`, `datetime.date`, and `datetime.time` instances
to `default`. This allows serializing datetimes to a custom format, e.g.,
HTTP dates:
```python
>>> import ormsgpack, datetime
>>> def default(obj):
... if isinstance(obj, datetime.datetime):
... return obj.strftime("%a, %d %b %Y %H:%M:%S GMT")
... raise TypeError
...
>>> ormsgpack.packb({"created_at": datetime.datetime(1970, 1, 1)})
b'\x81\xaacreated_at\xb31970-01-01T00:00:00'
>>> ormsgpack.packb({"created_at": datetime.datetime(1970, 1, 1)}, option=ormsgpack.OPT_PASSTHROUGH_DATETIME)
TypeError: Type is not msgpack serializable: datetime.datetime
>>> ormsgpack.packb(
... {"created_at": datetime.datetime(1970, 1, 1)},
... option=ormsgpack.OPT_PASSTHROUGH_DATETIME,
... default=default,
... )
b'\x81\xaacreated_at\xbdThu, 01 Jan 1970 00:00:00 GMT'
```
This does not affect datetimes in `dict` keys if using OPT_NON_STR_KEYS.
##### OPT_PASSTHROUGH_SUBCLASS
Passthrough subclasses of builtin types to `default`.
```python
>>> import ormsgpack
>>> class Secret(str):
... pass
...
>>> def default(obj):
... if isinstance(obj, Secret):
... return "******"
... raise TypeError
...
>>> ormsgpack.packb(Secret("zxc"))
b'\xa3zxc'
>>> ormsgpack.packb(Secret("zxc"), option=ormsgpack.OPT_PASSTHROUGH_SUBCLASS)
TypeError: Type is not msgpack serializable: Secret
>>> ormsgpack.packb(Secret("zxc"), option=ormsgpack.OPT_PASSTHROUGH_SUBCLASS, default=default)
b'\xa6******'
```
This does not affect serializing subclasses as `dict` keys if using
OPT_NON_STR_KEYS.
##### OPT_PASSTHROUGH_TUPLE
Passthrough tuples to `default`.
```python
>>> import ormsgpack
>>> ormsgpack.packb(
... (9193, "test", 42),
... )
b'\x93\xcd#\xe9\xa4test*'
>>> ormsgpack.unpackb(_)
[9193, 'test', 42]
>>> ormsgpack.packb(
... (9193, "test", 42),
... option=ormsgpack.OPT_PASSTHROUGH_TUPLE,
... default=lambda _: {"type": "tuple", "value": list(_)}
... )
b'\x82\xa4type\xa5tuple\xa5value\x93\xcd#\xe9\xa4test*'
>>> ormsgpack.unpackb(_)
{'type': 'tuple', 'value': [9193, 'test', 42]}
```
##### OPT_SERIALIZE_NUMPY
Serialize `numpy.ndarray` instances. For more, see
[numpy](#numpy).
##### OPT_SERIALIZE_PYDANTIC
Serialize `pydantic.BaseModel` instances.
##### OPT_SORT_KEYS
Serialize `dict` keys and pydantic model fields in sorted order. The default
is to serialize in an unspecified order.
This can be used to ensure the order is deterministic for hashing or tests.
It has a substantial performance penalty and is not recommended in general.
```python
>>> import ormsgpack
>>> ormsgpack.packb({"b": 1, "c": 2, "a": 3})
b'\x83\xa1b\x01\xa1c\x02\xa1a\x03'
>>> ormsgpack.packb({"b": 1, "c": 2, "a": 3}, option=ormsgpack.OPT_SORT_KEYS)
b'\x83\xa1a\x03\xa1b\x01\xa1c\x02'
```
The sorting is not collation/locale-aware:
```python
>>> import ormsgpack
>>> ormsgpack.packb({"a": 1, "รค": 2, "A": 3}, option=ormsgpack.OPT_SORT_KEYS)
b'\x83\xa1A\x03\xa1a\x01\xa2\xc3\xa4\x02'
```
`dataclass` also serialize as maps but this has no effect on them.
##### OPT_UTC_Z
Serialize a UTC timezone on `datetime.datetime` and `numpy.datetime64` instances
as `Z` instead of `+00:00`.
```python
>>> import ormsgpack, datetime
>>> ormsgpack.packb(
... datetime.datetime(1970, 1, 1, 0, 0, 0, tzinfo=datetime.timezone.utc),
... )
b'\xb91970-01-01T00:00:00+00:00'
>>> ormsgpack.packb(
... datetime.datetime(1970, 1, 1, 0, 0, 0, tzinfo=datetime.timezone.utc),
... option=ormsgpack.OPT_UTC_Z
... )
b'\xb41970-01-01T00:00:00Z'
```
### Deserialize
```python
def unpackb(
__obj: Union[bytes, bytearray, memoryview],
/,
ext_hook: Optional[Callable[[int, bytes], Any]] = ...,
option: Optional[int] = ...,
) -> Any: ...
```
`unpackb()` deserializes msgpack to Python objects. It deserializes to `dict`,
`list`, `int`, `float`, `str`, `bool`, `bytes` and `None` objects.
`bytes`, `bytearray`, `memoryview` input are accepted.
ormsgpack maintains a cache of map keys for the duration of the process. This
causes a net reduction in memory usage by avoiding duplicate strings. The
keys must be at most 64 bytes to be cached and 512 entries are stored.
The global interpreter lock (GIL) is held for the duration of the call.
It raises `MsgpackDecodeError` if given an invalid type or invalid
msgpack.
`MsgpackDecodeError` is a subclass of `ValueError`.
#### ext_hook
To deserialize extension types, specify the optional `ext_hook`
argument. The value should be a callable and is invoked with the
extension type and value as arguments.
```python
>>> import ormsgpack, decimal
>>> def ext_hook(tag, data):
... if tag == 0:
... return decimal.Decimal(data.decode())
... raise TypeError
...
>>> ormsgpack.packb(
... ormsgpack.Ext(0, str(decimal.Decimal("0.0842389659712649442845")).encode())
... )
b'\xc7\x18\x000.0842389659712649442845'
>>> ormsgpack.unpackb(_, ext_hook=ext_hook)
Decimal('0.0842389659712649442845'
```
#### option
`unpackb()` supports the `OPT_NON_STR_KEYS` option, that is similar to original msgpack's `strict_map_key=False`.
Be aware that this option is considered unsafe and disabled by default in msgpack due to possibility of HashDoS.
## Types
### dataclass
ormsgpack serializes instances of `dataclasses.dataclass` natively. It serializes
instances 40-50x as fast as other libraries and avoids a severe slowdown seen
in other libraries compared to serializing `dict`.
It is supported to pass all variants of dataclasses, including dataclasses
using `__slots__`, frozen dataclasses, those with optional or default
attributes, and subclasses. There is a performance benefit to not
using `__slots__`.
Dataclasses are serialized as maps, with every attribute serialized and in
the order given on class definition:
```python
>>> import dataclasses, ormsgpack, typing
>>> @dataclasses.dataclass
... class Member:
... id: int
... active: bool = dataclasses.field(default=False)
...
>>> @dataclasses.dataclass
... class Object:
... id: int
... name: str
... members: typing.List[Member]
...
>>> ormsgpack.packb(Object(1, "a", [Member(1, True), Member(2)]))
b'\x83\xa2id\x01\xa4name\xa1a\xa7members\x92\x82\xa2id\x01\xa6active\xc3\x82\xa2id\x02\xa6active\xc2'
```
#### Performance
![alt text](doc/dataclass.svg "dataclass")
```
--------------------------------------------------------------------------------- benchmark 'dataclass': 2 tests --------------------------------------------------------------------------------
Name (time in ms) Min Max Mean StdDev Median IQR Outliers OPS Rounds Iterations
-------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------
test_dataclass_ormsgpack 3.4248 (1.0) 7.7949 (1.0) 3.6266 (1.0) 0.3293 (1.0) 3.5815 (1.0) 0.0310 (1.0) 4;34 275.7434 (1.0) 240 1
test_dataclass_msgpack 140.2774 (40.96) 143.6087 (18.42) 141.3847 (38.99) 1.0038 (3.05) 141.1823 (39.42) 0.7304 (23.60) 2;1 7.0729 (0.03) 8 1
-------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------
```
### datetime
ormsgpack serializes `datetime.datetime` objects to
[RFC 3339](https://tools.ietf.org/html/rfc3339) format,
e.g., "1970-01-01T00:00:00+00:00". This is a subset of ISO 8601 and is
compatible with `isoformat()` in the standard library.
```python
>>> import ormsgpack, datetime, zoneinfo
>>> ormsgpack.packb(
... datetime.datetime(2018, 12, 1, 2, 3, 4, 9, tzinfo=zoneinfo.ZoneInfo('Australia/Adelaide'))
... )
b'\xd9 2018-12-01T02:03:04.000009+10:30'
>>> ormsgpack.unpackb(_)
'2018-12-01T02:03:04.000009+10:30'
>>> ormsgpack.packb(
... datetime.datetime.fromtimestamp(4123518902).replace(tzinfo=datetime.timezone.utc)
... )
b'\xb92100-09-02T00:55:02+00:00'
>>> ormsgpack.unpackb(_)
'2100-09-02T00:55:02+00:00'
>>> ormsgpack.packb(
... datetime.datetime.fromtimestamp(4123518902)
... )
b'\xb32100-09-02T00:55:02'
>>> ormsgpack.unpackb(_)
'2100-09-02T00:55:02'
```
`datetime.datetime` supports instances with a `tzinfo` that is `None`,
`datetime.timezone.utc`, a timezone instance from the python3.9+ `zoneinfo`
module, or a timezone instance from the third-party `pendulum`, `pytz`, or
`dateutil`/`arrow` libraries.
`datetime.time` objects must not have a `tzinfo`.
```python
>>> import ormsgpack, datetime
>>> ormsgpack.packb(datetime.time(12, 0, 15, 290))
b'\xaf12:00:15.000290'
>>> ormsgpack.unpackb(_)
'12:00:15.000290'
```
`datetime.date` objects will always serialize.
```python
>>> import ormsgpack, datetime
>>> ormsgpack.packb(datetime.date(1900, 1, 2))
b'\xaa1900-01-02'
>>> ormsgpack.unpackb(_)
'1900-01-02'
```
Errors with `tzinfo` result in `MsgpackEncodeError` being raised.
To disable serialization of `datetime` objects specify the option
`ormsgpack.OPT_PASSTHROUGH_DATETIME`.
To use "Z" suffix instead of "+00:00" to indicate UTC ("Zulu") time, use the option
`ormsgpack.OPT_UTC_Z`.
To assume datetimes without timezone are UTC, use the option `ormsgpack.OPT_NAIVE_UTC`.
### enum
ormsgpack serializes enums natively. Options apply to their values.
```python
>>> import enum, datetime, ormsgpack
>>> class DatetimeEnum(enum.Enum):
... EPOCH = datetime.datetime(1970, 1, 1, 0, 0, 0)
...
>>> ormsgpack.packb(DatetimeEnum.EPOCH)
b'\xb31970-01-01T00:00:00'
>>> ormsgpack.unpackb(_)
'1970-01-01T00:00:00'
>>> ormsgpack.packb(DatetimeEnum.EPOCH, option=ormsgpack.OPT_NAIVE_UTC)
b'\xb91970-01-01T00:00:00+00:00'
>>> ormsgpack.unpackb(_)
'1970-01-01T00:00:00+00:00'
```
Enums with members that are not supported types can be serialized using
`default`:
```python
>>> import enum, ormsgpack
>>> class Custom:
... def __init__(self, val):
... self.val = val
...
>>> def default(obj):
... if isinstance(obj, Custom):
... return obj.val
... raise TypeError
...
>>> class CustomEnum(enum.Enum):
... ONE = Custom(1)
...
>>> ormsgpack.packb(CustomEnum.ONE, default=default)
b'\x01'
>>> ormsgpack.unpackb(_)
1
```
### float
ormsgpack serializes and deserializes double precision floats with no loss of
precision and consistent rounding.
### int
ormsgpack serializes and deserializes 64-bit integers by default. The range
supported is a signed 64-bit integer's minimum (-9223372036854775807) to
an unsigned 64-bit integer's maximum (18446744073709551615).
### numpy
ormsgpack natively serializes `numpy.ndarray` and individual
`numpy.float64`, `numpy.float32`, `numpy.float16`,
`numpy.int64`, `numpy.int32`, `numpy.int16`, `numpy.int8`,
`numpy.uint64`, `numpy.uint32`, `numpy.uint16`, `numpy.uint8`,
`numpy.uintp`, `numpy.intp`, `numpy.datetime64`, and `numpy.bool`
instances.
`numpy.datetime64` instances are serialized as RFC 3339 strings.
ormsgpack is faster than all compared libraries at serializing
numpy instances. Serializing numpy data requires specifying
`option=ormsgpack.OPT_SERIALIZE_NUMPY`.
```python
>>> import ormsgpack, numpy
>>> ormsgpack.packb(
... numpy.array([[1, 2, 3], [4, 5, 6]]),
... option=ormsgpack.OPT_SERIALIZE_NUMPY,
... )
b'\x92\x93\x01\x02\x03\x93\x04\x05\x06'
>>> ormsgpack.unpackb(_)
[[1, 2, 3], [4, 5, 6]]
```
The array must be a contiguous C array (`C_CONTIGUOUS`) and one of the
supported datatypes.
If an array is not a contiguous C array or contains an supported datatype,
ormsgpack falls through to `default`. In `default`, `obj.tolist()` can be
specified. If an array is malformed, which is not expected,
`ormsgpack.MsgpackEncodeError` is raised.
#### Performance
![alt text](doc/numpy_float64.svg "numpy")
![alt text](doc/numpy_int8.svg "numpy int8")
![alt text](doc/numpy_int32.svg "numpy int32")
![alt text](doc/numpy_npbool.svg "numpy npbool")
![alt text](doc/numpy_uint8.svg "numpy uint8")
```
---------------------------------------------------------------------------------- benchmark 'numpy float64': 2 tests ---------------------------------------------------------------------------------
Name (time in ms) Min Max Mean StdDev Median IQR Outliers OPS Rounds Iterations
-------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------
test_numpy_ormsgpack[float64] 77.9625 (1.0) 85.2507 (1.0) 79.0326 (1.0) 1.9043 (1.0) 78.5505 (1.0) 0.7408 (1.0) 1;1 12.6530 (1.0) 13 1
test_numpy_msgpack[float64] 511.5176 (6.56) 606.9395 (7.12) 559.0017 (7.07) 44.0661 (23.14) 572.5499 (7.29) 81.2972 (109.75) 3;0 1.7889 (0.14) 5 1
-------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------
------------------------------------------------------------------------------------- benchmark 'numpy int32': 2 tests -------------------------------------------------------------------------------------
Name (time in ms) Min Max Mean StdDev Median IQR Outliers OPS Rounds Iterations
------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------
test_numpy_ormsgpack[int32] 197.8751 (1.0) 210.3111 (1.0) 201.1033 (1.0) 5.1886 (1.0) 198.8518 (1.0) 3.8297 (1.0) 1;1 4.9726 (1.0) 5 1
test_numpy_msgpack[int32] 1,363.8515 (6.89) 1,505.4747 (7.16) 1,428.2127 (7.10) 53.4176 (10.30) 1,425.3516 (7.17) 72.8064 (19.01) 2;0 0.7002 (0.14) 5 1
------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------
-------------------------------------------------------------------------------- benchmark 'numpy int8': 2 tests ---------------------------------------------------------------------------------
Name (time in ms) Min Max Mean StdDev Median IQR Outliers OPS Rounds Iterations
--------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------
test_numpy_ormsgpack[int8] 107.8013 (1.0) 113.7336 (1.0) 109.0364 (1.0) 1.7805 (1.0) 108.3574 (1.0) 0.4066 (1.0) 1;2 9.1712 (1.0) 10 1
test_numpy_msgpack[int8] 685.4149 (6.36) 703.2958 (6.18) 693.2396 (6.36) 7.9572 (4.47) 691.5435 (6.38) 14.4142 (35.45) 1;0 1.4425 (0.16) 5 1
--------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------
------------------------------------------------------------------------------------- benchmark 'numpy npbool': 2 tests --------------------------------------------------------------------------------------
Name (time in ms) Min Max Mean StdDev Median IQR Outliers OPS Rounds Iterations
--------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------
test_numpy_ormsgpack[npbool] 87.9005 (1.0) 89.5460 (1.0) 88.7928 (1.0) 0.5098 (1.0) 88.8508 (1.0) 0.6609 (1.0) 4;0 11.2622 (1.0) 12 1
test_numpy_msgpack[npbool] 1,095.0599 (12.46) 1,176.3442 (13.14) 1,120.5916 (12.62) 32.9993 (64.73) 1,110.4216 (12.50) 38.4189 (58.13) 1;0 0.8924 (0.08) 5 1
--------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------
--------------------------------------------------------------------------------- benchmark 'numpy uint8': 2 tests ---------------------------------------------------------------------------------
Name (time in ms) Min Max Mean StdDev Median IQR Outliers OPS Rounds Iterations
----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------
test_numpy_ormsgpack[uint8] 133.1743 (1.0) 134.7246 (1.0) 134.2793 (1.0) 0.4946 (1.0) 134.3120 (1.0) 0.4492 (1.0) 1;1 7.4472 (1.0) 8 1
test_numpy_msgpack[uint8] 727.1393 (5.46) 824.8247 (6.12) 775.7032 (5.78) 34.9887 (70.73) 775.9595 (5.78) 36.2824 (80.78) 2;0 1.2892 (0.17) 5 1
----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------
```
### uuid
ormsgpack serializes `uuid.UUID` instances to
[RFC 4122](https://tools.ietf.org/html/rfc4122) format, e.g.,
"f81d4fae-7dec-11d0-a765-00a0c91e6bf6".
```python
>>> import ormsgpack, uuid
>>> ormsgpack.packb(uuid.UUID('f81d4fae-7dec-11d0-a765-00a0c91e6bf6'))
b'\xd9$f81d4fae-7dec-11d0-a765-00a0c91e6bf6'
>>> ormsgpack.unpackb(_)
'f81d4fae-7dec-11d0-a765-00a0c91e6bf6'
>>> ormsgpack.packb(uuid.uuid5(uuid.NAMESPACE_DNS, "python.org"))
b'\xd9$886313e1-3b8a-5372-9b90-0c9aee199e5d'
>>> ormsgpack.unpackb(_)
'886313e1-3b8a-5372-9b90-0c9aee199e5d
```
### Pydantic
ormsgpack serializes `pydantic.BaseModel` instances natively, with
[duck-typing](https://docs.pydantic.dev/2.10/concepts/serialization/#serializing-with-duck-typing).
This is equivalent to serializing
`model.model_dump(serialize_as_any=True)` with Pydantic V2 or
`model.dict()`with Pydantic V1.
#### Performance
![alt text](doc/pydantic.svg "pydantic")
```
-------------------------------------------------------------------------------- benchmark 'pydantic': 2 tests ---------------------------------------------------------------------------------
Name (time in ms) Min Max Mean StdDev Median IQR Outliers OPS Rounds Iterations
------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------
test_pydantic_ormsgpack 4.3918 (1.0) 12.6521 (1.0) 4.8550 (1.0) 1.1455 (3.98) 4.6101 (1.0) 0.0662 (1.0) 11;24 205.9727 (1.0) 204 1
test_pydantic_msgpack 124.5500 (28.36) 125.5427 (9.92) 125.0582 (25.76) 0.2877 (1.0) 125.0855 (27.13) 0.2543 (3.84) 2;0 7.9963 (0.04) 8 1
------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------
```
## Latency
### Graphs
![alt text](doc/twitter_packb.svg "twitter.json serialization")
![alt text](doc/twitter_unpackb.svg "twitter.json deserialization")
![alt text](doc/github_packb.svg "github.json serialization")
![alt text](doc/github_unpackb.svg "github.json deserialization")
![alt text](doc/citm_catalog_packb.svg "citm_catalog.json serialization")
![alt text](doc/citm_catalog_unpackb.svg "citm_catalog.json deserialization")
![alt text](doc/canada_packb.svg "canada.json serialization")
![alt text](doc/canada_unpackb.svg "canada.json deserialization")
### Data
```
----------------------------------------------------------------------------- benchmark 'canada packb': 2 tests ------------------------------------------------------------------------------
Name (time in ms) Min Max Mean StdDev Median IQR Outliers OPS Rounds Iterations
----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------
test_ormsgpack_packb[canada] 3.5302 (1.0) 3.8939 (1.0) 3.7319 (1.0) 0.0563 (1.0) 3.7395 (1.0) 0.0484 (1.0) 56;22 267.9571 (1.0) 241 1
test_msgpack_packb[canada] 8.8642 (2.51) 14.0432 (3.61) 9.3660 (2.51) 0.5649 (10.03) 9.2983 (2.49) 0.0982 (2.03) 3;11 106.7691 (0.40) 106 1
----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------
------------------------------------------------------------------------------- benchmark 'canada unpackb': 2 tests --------------------------------------------------------------------------------
Name (time in ms) Min Max Mean StdDev Median IQR Outliers OPS Rounds Iterations
----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------
test_msgpack_unpackb[canada] 10.1176 (1.0) 62.0466 (1.18) 33.4806 (1.0) 18.8279 (1.0) 46.6582 (1.0) 38.5921 (1.02) 30;0 29.8680 (1.0) 67 1
test_ormsgpack_unpackb[canada] 11.3992 (1.13) 52.6587 (1.0) 34.1842 (1.02) 18.9461 (1.01) 47.6456 (1.02) 37.8024 (1.0) 8;0 29.2533 (0.98) 20 1
----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------
----------------------------------------------------------------------------- benchmark 'citm_catalog packb': 2 tests -----------------------------------------------------------------------------
Name (time in ms) Min Max Mean StdDev Median IQR Outliers OPS Rounds Iterations
---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------
test_ormsgpack_packb[citm_catalog] 1.8024 (1.0) 2.1259 (1.0) 1.9487 (1.0) 0.0346 (1.0) 1.9525 (1.0) 0.0219 (1.0) 79;60 513.1650 (1.0) 454 1
test_msgpack_packb[citm_catalog] 3.4195 (1.90) 3.8128 (1.79) 3.6928 (1.90) 0.0535 (1.55) 3.7009 (1.90) 0.0250 (1.14) 47;49 270.7958 (0.53) 257 1
---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------
------------------------------------------------------------------------------ benchmark 'citm_catalog unpackb': 2 tests ------------------------------------------------------------------------------
Name (time in ms) Min Max Mean StdDev Median IQR Outliers OPS Rounds Iterations
-------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------
test_ormsgpack_unpackb[citm_catalog] 5.6986 (1.0) 46.1843 (1.0) 14.2491 (1.0) 15.9791 (1.0) 6.1051 (1.0) 0.3074 (1.0) 5;5 70.1798 (1.0) 23 1
test_msgpack_unpackb[citm_catalog] 7.2600 (1.27) 56.6642 (1.23) 16.4095 (1.15) 16.3257 (1.02) 7.7364 (1.27) 0.4944 (1.61) 28;29 60.9404 (0.87) 125 1
-------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------
----------------------------------------------------------------------------------- benchmark 'github packb': 2 tests -----------------------------------------------------------------------------------
Name (time in us) Min Max Mean StdDev Median IQR Outliers OPS (Kops/s) Rounds Iterations
---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------
test_ormsgpack_packb[github] 73.0000 (1.0) 215.9000 (1.0) 80.4826 (1.0) 4.8889 (1.0) 80.3000 (1.0) 1.1000 (1.83) 866;1118 12.4250 (1.0) 6196 1
test_msgpack_packb[github] 103.8000 (1.42) 220.8000 (1.02) 112.8049 (1.40) 4.9686 (1.02) 113.0000 (1.41) 0.6000 (1.0) 1306;1560 8.8649 (0.71) 7028 1
---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------
----------------------------------------------------------------------------------- benchmark 'github unpackb': 2 tests -----------------------------------------------------------------------------------
Name (time in us) Min Max Mean StdDev Median IQR Outliers OPS (Kops/s) Rounds Iterations
-----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------
test_ormsgpack_unpackb[github] 201.3000 (1.0) 318.5000 (1.0) 219.0861 (1.0) 6.7340 (1.0) 219.1000 (1.0) 1.2000 (1.0) 483;721 4.5644 (1.0) 3488 1
test_msgpack_unpackb[github] 289.8000 (1.44) 436.0000 (1.37) 314.9631 (1.44) 9.4130 (1.40) 315.1000 (1.44) 2.3000 (1.92) 341;557 3.1750 (0.70) 2477 1
-----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------
--------------------------------------------------------------------------------------- benchmark 'twitter packb': 2 tests ---------------------------------------------------------------------------------------
Name (time in us) Min Max Mean StdDev Median IQR Outliers OPS Rounds Iterations
------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------
test_ormsgpack_packb[twitter] 820.7000 (1.0) 2,945.2000 (2.03) 889.3791 (1.0) 78.4139 (2.43) 884.2000 (1.0) 12.5250 (1.0) 4;76 1,124.3799 (1.0) 809 1
test_msgpack_packb[twitter] 1,209.3000 (1.47) 1,451.2000 (1.0) 1,301.3615 (1.46) 32.2147 (1.0) 1,306.7000 (1.48) 14.1000 (1.13) 118;138 768.4260 (0.68) 592 1
------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------
------------------------------------------------------------------------------ benchmark 'twitter unpackb': 2 tests -----------------------------------------------------------------------------
Name (time in ms) Min Max Mean StdDev Median IQR Outliers OPS Rounds Iterations
-------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------
test_ormsgpack_unpackb[twitter] 2.7097 (1.0) 41.1530 (1.0) 3.2721 (1.0) 3.5860 (1.03) 2.8868 (1.0) 0.0614 (1.32) 4;38 305.6098 (1.0) 314 1
test_msgpack_unpackb[twitter] 3.8079 (1.41) 42.0617 (1.02) 4.4459 (1.36) 3.4893 (1.0) 4.1097 (1.42) 0.0465 (1.0) 2;54 224.9267 (0.74) 228 1
-------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------
```
### Reproducing
The above was measured using Python 3.7.9 on Azure Linux VM (x86_64) with ormsgpack 0.2.1 and msgpack 1.0.2.
The latency results can be reproduced using `./scripts/benchmark.sh` and graphs using
`pytest --benchmark-histogram benchmarks/bench_*`.
## Questions
### Why can't I install it from PyPI?
Probably `pip` needs to be upgraded to version 20.3 or later to support
the latest manylinux_x_y or universal2 wheel formats.
### Will it deserialize to dataclasses, UUIDs, decimals, etc or support object_hook?
No. This requires a schema specifying what types are expected and how to
handle errors etc. This is addressed by data validation libraries a
level above this.
## Packaging
To package ormsgpack requires [Rust](https://www.rust-lang.org/) 1.70
or newer and the [maturin](https://github.com/PyO3/maturin) build
tool. The default feature `unstable-simd` enables the usage of SIMD
operations and requires nightly Rust. The recommended build command
is:
```sh
maturin build --release --strip
```
ormsgpack is tested on Linux/amd64, Linux/aarch64, Linux/armv7, macOS/amd64 and Windows/amd64.
There are no runtime dependencies other than libc.
## License
orjson was written by ijl <<ijl@mailbox.org>>, copyright 2018 - 2021, licensed
under both the Apache 2 and MIT licenses.
ormsgpack was forked from orjson by Aviram Hassan and is now maintained by Emanuele Giaquinta (@exg), licensed
same as orjson.
Raw data
{
"_id": null,
"home_page": "https://github.com/aviramha/ormsgpack",
"name": "ormsgpack",
"maintainer": null,
"docs_url": null,
"requires_python": ">=3.9",
"maintainer_email": null,
"keywords": "fast, msgpack, dataclass, dataclasses, datetime",
"author": "Aviram Hassan <aviramyhassan@gmail.com>, Emanuele Giaquinta <emanuele.giaquinta@gmail.com>",
"author_email": "Aviram Hassan <aviramyhassan@gmail.com>, Emanuele Giaquinta <emanuele.giaquinta@gmail.com>",
"download_url": "https://files.pythonhosted.org/packages/7d/4c/562457de7aab8102c8505ac591ddfd117d554e0b31d7f1b88ca8ffed7703/ormsgpack-1.7.0.tar.gz",
"platform": null,
"description": "# ormsgpack\n![PyPI](https://img.shields.io/pypi/v/ormsgpack)\n![PyPI - Downloads](https://img.shields.io/pypi/dm/ormsgpack)\n\normsgpack is a fast msgpack serialization library for Python derived\nfrom [orjson](https://github.com/ijl/orjson), with native support for\nvarious Python types.\n\normsgpack supports CPython 3.9, 3.10, 3.11, 3.12 and 3.13. Releases\nfollow semantic versioning and serializing a new object type without\nan opt-in flag is considered a breaking change.\n\normsgpack is licensed under both the Apache 2.0 and MIT licenses. The\nrepository and issue tracker is\n[github.com/aviramha/ormsgpack](https://github.com/aviramha/ormsgpack), and patches may be\nsubmitted there. There is a\n[CHANGELOG](https://github.com/aviramha/ormsgpack/blob/master/CHANGELOG.md)\navailable in the repository.\n\n1. [Usage](#usage)\n 1. [Install](#install)\n 2. [Quickstart](#quickstart)\n 4. [Serialize](#serialize)\n 1. [default](#default)\n 2. [option](#option)\n 5. [Deserialize](#deserialize)\n2. [Types](#types)\n 1. [dataclass](#dataclass)\n 2. [datetime](#datetime)\n 3. [enum](#enum)\n 4. [float](#float)\n 5. [int](#int)\n 6. [numpy](#numpy)\n 7. [uuid](#uuid)\n 8. [pydantic](#pydantic)\n3. [Latency](#latency)\n4. [Questions](#questions)\n5. [Packaging](#packaging)\n6. [License](#license)\n\n## Usage\n\n### Install\n\nTo install a wheel from PyPI:\n\n```sh\npip install --upgrade \"pip>=20.3\" # manylinux_x_y, universal2 wheel support\npip install --upgrade ormsgpack\n```\n\nTo build a wheel, see [packaging](#packaging).\n\n### Quickstart\n\nThis is an example of serializing, with options specified, and deserializing:\n\n```python\n>>> import ormsgpack, datetime, numpy\n>>> data = {\n... \"type\": \"job\",\n... \"created_at\": datetime.datetime(1970, 1, 1),\n... \"status\": \"\ud83c\udd97\",\n... \"payload\": numpy.array([[1, 2], [3, 4]]),\n... }\n>>> ormsgpack.packb(data, option=ormsgpack.OPT_NAIVE_UTC | ormsgpack.OPT_SERIALIZE_NUMPY)\nb'\\x84\\xa4type\\xa3job\\xaacreated_at\\xb91970-01-01T00:00:00+00:00\\xa6status\\xa4\\xf0\\x9f\\x86\\x97\\xa7payload\\x92\\x92\\x01\\x02\\x92\\x03\\x04'\n>>> ormsgpack.unpackb(_)\n{'type': 'job', 'created_at': '1970-01-01T00:00:00+00:00', 'status': '\ud83c\udd97', 'payload': [[1, 2], [3, 4]]}\n```\n\n### Serialize\n\n```python\ndef packb(\n __obj: Any,\n default: Optional[Callable[[Any], Any]] = ...,\n option: Optional[int] = ...,\n) -> bytes: ...\n```\n\n`packb()` serializes Python objects to msgpack.\n\nIt natively serializes\n`bytes`, `str`, `dict`, `list`, `tuple`, `int`, `float`, `bool`,\n`dataclasses.dataclass`, `typing.TypedDict`, `datetime.datetime`,\n`datetime.date`, `datetime.time`, `uuid.UUID`, `numpy.ndarray`, and\n`None` instances. It supports arbitrary types through `default`. It\nserializes subclasses of `str`, `int`, `dict`, `list`,\n`dataclasses.dataclass`, and `enum.Enum`. It does not serialize subclasses\nof `tuple` to avoid serializing `namedtuple` objects as arrays. To avoid\nserializing subclasses, specify the option `ormsgpack.OPT_PASSTHROUGH_SUBCLASS`.\n\nThe output is a `bytes` object.\n\nThe global interpreter lock (GIL) is held for the duration of the call.\n\nIt raises `MsgpackEncodeError` on an unsupported type. This exception message\ndescribes the invalid object with the error message\n`Type is not msgpack serializable: ...`. To fix this, specify\n[default](#default).\n\nIt raises `MsgpackEncodeError` on a `str` that contains invalid UTF-8.\n\nIt raises `MsgpackEncodeError` if a `dict` has a key of a type other than `str` or `bytes`,\nunless `OPT_NON_STR_KEYS` is specified.\n\nIt raises `MsgpackEncodeError` if the output of `default` recurses to handling by\n`default` more than 254 levels deep.\n\nIt raises `MsgpackEncodeError` on circular references.\n\nIt raises `MsgpackEncodeError` if a `tzinfo` on a datetime object is\nunsupported.\n\n`MsgpackEncodeError` is a subclass of `TypeError`.\n\n#### default\n\nTo serialize a subclass or arbitrary types, specify `default` as a\ncallable that returns a supported type. `default` may be a function,\nlambda, or callable class instance. To specify that a type was not\nhandled by `default`, raise an exception such as `TypeError`.\n\n```python\n>>> import ormsgpack, decimal\n>>> def default(obj):\n... if isinstance(obj, decimal.Decimal):\n... return str(obj)\n... raise TypeError\n...\n>>> ormsgpack.packb(decimal.Decimal(\"0.0842389659712649442845\"))\nTypeError: Type is not msgpack serializable: decimal.Decimal\n>>> ormsgpack.packb(decimal.Decimal(\"0.0842389659712649442845\"), default=default)\nb'\\xb80.0842389659712649442845'\n>>> ormsgpack.packb({1, 2}, default=default)\nTypeError: Type is not msgpack serializable: set\n```\n\nThe `default` callable may return an object that itself\nmust be handled by `default` up to 254 times before an exception\nis raised.\n\nIt is important that `default` raise an exception if a type cannot be handled.\nPython otherwise implicitly returns `None`, which appears to the caller\nlike a legitimate value and is serialized:\n\n```python\n>>> import ormsgpack, decimal\n>>> def default(obj):\n... if isinstance(obj, decimal.Decimal):\n... return str(obj)\n...\n>>> ormsgpack.packb({\"set\":{1, 2}}, default=default)\nb'\\x81\\xa3set\\xc0'\n>>> ormsgpack.unpackb(_)\n{'set': None}\n```\n\nTo serialize a type as a MessagePack extension type, return an\n`ormsgpack.Ext` object. The instantiation arguments are an integer in\nthe range `[0, 127]` and a `bytes` object, defining the type and\nvalue, respectively.\n\n```python\n>>> import ormsgpack, decimal\n>>> def default(obj):\n... if isinstance(obj, decimal.Decimal):\n... return ormsgpack.Ext(0, str(obj).encode())\n... raise TypeError\n...\n>>> ormsgpack.packb(decimal.Decimal(\"0.0842389659712649442845\"), default=default)\nb'\\xc7\\x18\\x000.0842389659712649442845'\n```\n\n#### option\n\nTo modify how data is serialized, specify `option`. Each `option` is an integer\nconstant in `ormsgpack`. To specify multiple options, mask them together, e.g.,\n`option=ormsgpack.OPT_NON_STR_KEYS | ormsgpack.OPT_NAIVE_UTC`.\n\n##### OPT_NAIVE_UTC\n\nSerialize `datetime.datetime` objects without a `tzinfo` and `numpy.datetime64`\nobjects as UTC. This has no effect on `datetime.datetime` objects that have\n`tzinfo` set.\n\n```python\n>>> import ormsgpack, datetime\n>>> ormsgpack.packb(\n... datetime.datetime(1970, 1, 1, 0, 0, 0),\n... )\nb'\\xb31970-01-01T00:00:00'\n>>> ormsgpack.unpackb(_)\n'1970-01-01T00:00:00'\n>>> ormsgpack.packb(\n... datetime.datetime(1970, 1, 1, 0, 0, 0),\n... option=ormsgpack.OPT_NAIVE_UTC,\n... )\nb'\\xb91970-01-01T00:00:00+00:00'\n>>> ormsgpack.unpackb(_)\n'1970-01-01T00:00:00+00:00'\n```\n\n##### OPT_NON_STR_KEYS\n\nSerialize `dict` keys of type other than `str`. This allows `dict` keys\nto be one of `str`, `int`, `float`, `bool`, `None`, `datetime.datetime`,\n`datetime.date`, `datetime.time`, `enum.Enum`, and `uuid.UUID`.\n\n```python\n>>> import ormsgpack, datetime, uuid\n>>> ormsgpack.packb(\n... {uuid.UUID(\"7202d115-7ff3-4c81-a7c1-2a1f067b1ece\"): [1, 2, 3]},\n... option=ormsgpack.OPT_NON_STR_KEYS,\n... )\nb'\\x81\\xd9$7202d115-7ff3-4c81-a7c1-2a1f067b1ece\\x93\\x01\\x02\\x03'\n>>> ormsgpack.unpackb(_)\n{'7202d115-7ff3-4c81-a7c1-2a1f067b1ece': [1, 2, 3]}\n>>> ormsgpack.packb(\n... {datetime.datetime(1970, 1, 1, 0, 0, 0): [1, 2, 3]},\n... option=ormsgpack.OPT_NON_STR_KEYS | ormsgpack.OPT_NAIVE_UTC,\n... )\nb'\\x81\\xb91970-01-01T00:00:00+00:00\\x93\\x01\\x02\\x03'\n>>> ormsgpack.unpackb(_)\n{'1970-01-01T00:00:00+00:00': [1, 2, 3]}\n```\n\nThese types are generally serialized how they would be as\nvalues, e.g., `datetime.datetime` is still an RFC 3339 string and respects\noptions affecting it.\n\nThis option has the risk of creating duplicate keys. This is because non-`str`\nobjects may serialize to the same `str` as an existing key, e.g.,\n`{\"1970-01-01T00:00:00+00:00\": true, datetime.datetime(1970, 1, 1, 0, 0, 0): false}`.\nThe last key to be inserted to the `dict` will be serialized last and a msgpack deserializer will presumably take the last\noccurrence of a key (in the above, `false`). The first value will be lost.\n\nThis option is not compatible with `ormsgpack.OPT_SORT_KEYS`.\n\n##### OPT_OMIT_MICROSECONDS\n\nDo not serialize the microsecond component of `datetime.datetime`,\n`datetime.time` and `numpy.datetime64` instances.\n\n```python\n>>> import ormsgpack, datetime\n>>> ormsgpack.packb(\n... datetime.datetime(1970, 1, 1, 0, 0, 0, 1),\n... )\nb'\\xba1970-01-01T00:00:00.000001'\n>>> ormsgpack.unpackb(_)\n'1970-01-01T00:00:00.000001'\n>>> ormsgpack.packb(\n... datetime.datetime(1970, 1, 1, 0, 0, 0, 1),\n... option=ormsgpack.OPT_OMIT_MICROSECONDS,\n... )\nb'\\xb31970-01-01T00:00:00'\n>>> ormsgpack.unpackb(_)\n'1970-01-01T00:00:00'\n```\n\n##### OPT_PASSTHROUGH_BIG_INT\n\nEnables passthrough of big (Python) ints. By setting this option, one can set a `default` function for ints larger than 63 bits, smaller ints are still serialized efficiently.\n\n```python\n>>> import ormsgpack\n>>> ormsgpack.packb(\n... 2**65,\n... )\nTypeError: Integer exceeds 64-bit range\n>>> ormsgpack.packb(\n... 2**65,\n... option=ormsgpack.OPT_PASSTHROUGH_BIG_INT,\n... default=lambda _: {\"type\": \"bigint\", \"value\": str(_) }\n... )\nb'\\x82\\xa4type\\xa6bigint\\xa5value\\xb436893488147419103232'\n>>> ormsgpack.unpackb(_)\n{'type': 'bigint', 'value': '36893488147419103232'}\n```\n\n##### OPT_PASSTHROUGH_DATACLASS\n\nPassthrough `dataclasses.dataclass` instances to `default`. This allows\ncustomizing their output but is much slower.\n\n\n```python\n>>> import ormsgpack, dataclasses\n>>> @dataclasses.dataclass\n... class User:\n... id: str\n... name: str\n... password: str\n...\n>>> def default(obj):\n... if isinstance(obj, User):\n... return {\"id\": obj.id, \"name\": obj.name}\n... raise TypeError\n...\n>>> ormsgpack.packb(User(\"3b1\", \"asd\", \"zxc\"))\nb'\\x83\\xa2id\\xa33b1\\xa4name\\xa3asd\\xa8password\\xa3zxc'\n>>> ormsgpack.packb(User(\"3b1\", \"asd\", \"zxc\"), option=ormsgpack.OPT_PASSTHROUGH_DATACLASS)\nTypeError: Type is not msgpack serializable: User\n>>> ormsgpack.packb(\n... User(\"3b1\", \"asd\", \"zxc\"),\n... option=ormsgpack.OPT_PASSTHROUGH_DATACLASS,\n... default=default,\n... )\nb'\\x82\\xa2id\\xa33b1\\xa4name\\xa3asd'\n```\n\n##### OPT_PASSTHROUGH_DATETIME\n\nPassthrough `datetime.datetime`, `datetime.date`, and `datetime.time` instances\nto `default`. This allows serializing datetimes to a custom format, e.g.,\nHTTP dates:\n\n```python\n>>> import ormsgpack, datetime\n>>> def default(obj):\n... if isinstance(obj, datetime.datetime):\n... return obj.strftime(\"%a, %d %b %Y %H:%M:%S GMT\")\n... raise TypeError\n...\n>>> ormsgpack.packb({\"created_at\": datetime.datetime(1970, 1, 1)})\nb'\\x81\\xaacreated_at\\xb31970-01-01T00:00:00'\n>>> ormsgpack.packb({\"created_at\": datetime.datetime(1970, 1, 1)}, option=ormsgpack.OPT_PASSTHROUGH_DATETIME)\nTypeError: Type is not msgpack serializable: datetime.datetime\n>>> ormsgpack.packb(\n... {\"created_at\": datetime.datetime(1970, 1, 1)},\n... option=ormsgpack.OPT_PASSTHROUGH_DATETIME,\n... default=default,\n... )\nb'\\x81\\xaacreated_at\\xbdThu, 01 Jan 1970 00:00:00 GMT'\n```\n\nThis does not affect datetimes in `dict` keys if using OPT_NON_STR_KEYS.\n\n##### OPT_PASSTHROUGH_SUBCLASS\n\nPassthrough subclasses of builtin types to `default`.\n\n```python\n>>> import ormsgpack\n>>> class Secret(str):\n... pass\n...\n>>> def default(obj):\n... if isinstance(obj, Secret):\n... return \"******\"\n... raise TypeError\n...\n>>> ormsgpack.packb(Secret(\"zxc\"))\nb'\\xa3zxc'\n>>> ormsgpack.packb(Secret(\"zxc\"), option=ormsgpack.OPT_PASSTHROUGH_SUBCLASS)\nTypeError: Type is not msgpack serializable: Secret\n>>> ormsgpack.packb(Secret(\"zxc\"), option=ormsgpack.OPT_PASSTHROUGH_SUBCLASS, default=default)\nb'\\xa6******'\n```\n\nThis does not affect serializing subclasses as `dict` keys if using\nOPT_NON_STR_KEYS.\n\n##### OPT_PASSTHROUGH_TUPLE\n\nPassthrough tuples to `default`.\n\n```python\n>>> import ormsgpack\n>>> ormsgpack.packb(\n... (9193, \"test\", 42),\n... )\nb'\\x93\\xcd#\\xe9\\xa4test*'\n>>> ormsgpack.unpackb(_)\n[9193, 'test', 42]\n>>> ormsgpack.packb(\n... (9193, \"test\", 42),\n... option=ormsgpack.OPT_PASSTHROUGH_TUPLE,\n... default=lambda _: {\"type\": \"tuple\", \"value\": list(_)}\n... )\nb'\\x82\\xa4type\\xa5tuple\\xa5value\\x93\\xcd#\\xe9\\xa4test*'\n>>> ormsgpack.unpackb(_)\n{'type': 'tuple', 'value': [9193, 'test', 42]}\n```\n\n##### OPT_SERIALIZE_NUMPY\n\nSerialize `numpy.ndarray` instances. For more, see\n[numpy](#numpy).\n\n##### OPT_SERIALIZE_PYDANTIC\nSerialize `pydantic.BaseModel` instances.\n\n##### OPT_SORT_KEYS\n\nSerialize `dict` keys and pydantic model fields in sorted order. The default\nis to serialize in an unspecified order.\n\nThis can be used to ensure the order is deterministic for hashing or tests.\nIt has a substantial performance penalty and is not recommended in general.\n\n```python\n>>> import ormsgpack\n>>> ormsgpack.packb({\"b\": 1, \"c\": 2, \"a\": 3})\nb'\\x83\\xa1b\\x01\\xa1c\\x02\\xa1a\\x03'\n>>> ormsgpack.packb({\"b\": 1, \"c\": 2, \"a\": 3}, option=ormsgpack.OPT_SORT_KEYS)\nb'\\x83\\xa1a\\x03\\xa1b\\x01\\xa1c\\x02'\n```\n\nThe sorting is not collation/locale-aware:\n\n```python\n>>> import ormsgpack\n>>> ormsgpack.packb({\"a\": 1, \"\u00e4\": 2, \"A\": 3}, option=ormsgpack.OPT_SORT_KEYS)\nb'\\x83\\xa1A\\x03\\xa1a\\x01\\xa2\\xc3\\xa4\\x02'\n```\n\n`dataclass` also serialize as maps but this has no effect on them.\n\n##### OPT_UTC_Z\n\nSerialize a UTC timezone on `datetime.datetime` and `numpy.datetime64` instances\nas `Z` instead of `+00:00`.\n\n```python\n>>> import ormsgpack, datetime\n>>> ormsgpack.packb(\n... datetime.datetime(1970, 1, 1, 0, 0, 0, tzinfo=datetime.timezone.utc),\n... )\nb'\\xb91970-01-01T00:00:00+00:00'\n>>> ormsgpack.packb(\n... datetime.datetime(1970, 1, 1, 0, 0, 0, tzinfo=datetime.timezone.utc),\n... option=ormsgpack.OPT_UTC_Z\n... )\nb'\\xb41970-01-01T00:00:00Z'\n```\n\n### Deserialize\n```python\ndef unpackb(\n __obj: Union[bytes, bytearray, memoryview],\n /,\n ext_hook: Optional[Callable[[int, bytes], Any]] = ...,\n option: Optional[int] = ...,\n) -> Any: ...\n```\n\n`unpackb()` deserializes msgpack to Python objects. It deserializes to `dict`,\n`list`, `int`, `float`, `str`, `bool`, `bytes` and `None` objects.\n\n`bytes`, `bytearray`, `memoryview` input are accepted.\n\normsgpack maintains a cache of map keys for the duration of the process. This\ncauses a net reduction in memory usage by avoiding duplicate strings. The\nkeys must be at most 64 bytes to be cached and 512 entries are stored.\n\nThe global interpreter lock (GIL) is held for the duration of the call.\n\nIt raises `MsgpackDecodeError` if given an invalid type or invalid\nmsgpack.\n\n`MsgpackDecodeError` is a subclass of `ValueError`.\n\n#### ext_hook\n\nTo deserialize extension types, specify the optional `ext_hook`\nargument. The value should be a callable and is invoked with the\nextension type and value as arguments.\n\n```python\n>>> import ormsgpack, decimal\n>>> def ext_hook(tag, data):\n... if tag == 0:\n... return decimal.Decimal(data.decode())\n... raise TypeError\n...\n>>> ormsgpack.packb(\n... ormsgpack.Ext(0, str(decimal.Decimal(\"0.0842389659712649442845\")).encode())\n... )\nb'\\xc7\\x18\\x000.0842389659712649442845'\n>>> ormsgpack.unpackb(_, ext_hook=ext_hook)\nDecimal('0.0842389659712649442845'\n```\n\n#### option\n`unpackb()` supports the `OPT_NON_STR_KEYS` option, that is similar to original msgpack's `strict_map_key=False`.\nBe aware that this option is considered unsafe and disabled by default in msgpack due to possibility of HashDoS.\n\n## Types\n\n### dataclass\n\normsgpack serializes instances of `dataclasses.dataclass` natively. It serializes\ninstances 40-50x as fast as other libraries and avoids a severe slowdown seen\nin other libraries compared to serializing `dict`.\n\nIt is supported to pass all variants of dataclasses, including dataclasses\nusing `__slots__`, frozen dataclasses, those with optional or default\nattributes, and subclasses. There is a performance benefit to not\nusing `__slots__`.\n\nDataclasses are serialized as maps, with every attribute serialized and in\nthe order given on class definition:\n\n```python\n>>> import dataclasses, ormsgpack, typing\n>>> @dataclasses.dataclass\n... class Member:\n... id: int\n... active: bool = dataclasses.field(default=False)\n...\n>>> @dataclasses.dataclass\n... class Object:\n... id: int\n... name: str\n... members: typing.List[Member]\n...\n>>> ormsgpack.packb(Object(1, \"a\", [Member(1, True), Member(2)]))\nb'\\x83\\xa2id\\x01\\xa4name\\xa1a\\xa7members\\x92\\x82\\xa2id\\x01\\xa6active\\xc3\\x82\\xa2id\\x02\\xa6active\\xc2'\n```\n#### Performance\n![alt text](doc/dataclass.svg \"dataclass\")\n\n```\n--------------------------------------------------------------------------------- benchmark 'dataclass': 2 tests --------------------------------------------------------------------------------\nName (time in ms) Min Max Mean StdDev Median IQR Outliers OPS Rounds Iterations\n-------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------\ntest_dataclass_ormsgpack 3.4248 (1.0) 7.7949 (1.0) 3.6266 (1.0) 0.3293 (1.0) 3.5815 (1.0) 0.0310 (1.0) 4;34 275.7434 (1.0) 240 1\ntest_dataclass_msgpack 140.2774 (40.96) 143.6087 (18.42) 141.3847 (38.99) 1.0038 (3.05) 141.1823 (39.42) 0.7304 (23.60) 2;1 7.0729 (0.03) 8 1\n-------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------\n```\n\n### datetime\n\normsgpack serializes `datetime.datetime` objects to\n[RFC 3339](https://tools.ietf.org/html/rfc3339) format,\ne.g., \"1970-01-01T00:00:00+00:00\". This is a subset of ISO 8601 and is\ncompatible with `isoformat()` in the standard library.\n\n```python\n>>> import ormsgpack, datetime, zoneinfo\n>>> ormsgpack.packb(\n... datetime.datetime(2018, 12, 1, 2, 3, 4, 9, tzinfo=zoneinfo.ZoneInfo('Australia/Adelaide'))\n... )\nb'\\xd9 2018-12-01T02:03:04.000009+10:30'\n>>> ormsgpack.unpackb(_)\n'2018-12-01T02:03:04.000009+10:30'\n>>> ormsgpack.packb(\n... datetime.datetime.fromtimestamp(4123518902).replace(tzinfo=datetime.timezone.utc)\n... )\nb'\\xb92100-09-02T00:55:02+00:00'\n>>> ormsgpack.unpackb(_)\n'2100-09-02T00:55:02+00:00'\n>>> ormsgpack.packb(\n... datetime.datetime.fromtimestamp(4123518902)\n... )\nb'\\xb32100-09-02T00:55:02'\n>>> ormsgpack.unpackb(_)\n'2100-09-02T00:55:02'\n```\n\n`datetime.datetime` supports instances with a `tzinfo` that is `None`,\n`datetime.timezone.utc`, a timezone instance from the python3.9+ `zoneinfo`\nmodule, or a timezone instance from the third-party `pendulum`, `pytz`, or\n`dateutil`/`arrow` libraries.\n\n`datetime.time` objects must not have a `tzinfo`.\n\n```python\n>>> import ormsgpack, datetime\n>>> ormsgpack.packb(datetime.time(12, 0, 15, 290))\nb'\\xaf12:00:15.000290'\n>>> ormsgpack.unpackb(_)\n'12:00:15.000290'\n```\n\n`datetime.date` objects will always serialize.\n\n```python\n>>> import ormsgpack, datetime\n>>> ormsgpack.packb(datetime.date(1900, 1, 2))\nb'\\xaa1900-01-02'\n>>> ormsgpack.unpackb(_)\n'1900-01-02'\n```\n\nErrors with `tzinfo` result in `MsgpackEncodeError` being raised.\n\nTo disable serialization of `datetime` objects specify the option\n`ormsgpack.OPT_PASSTHROUGH_DATETIME`.\n\nTo use \"Z\" suffix instead of \"+00:00\" to indicate UTC (\"Zulu\") time, use the option\n`ormsgpack.OPT_UTC_Z`.\n\nTo assume datetimes without timezone are UTC, use the option `ormsgpack.OPT_NAIVE_UTC`.\n\n### enum\n\normsgpack serializes enums natively. Options apply to their values.\n\n```python\n>>> import enum, datetime, ormsgpack\n>>> class DatetimeEnum(enum.Enum):\n... EPOCH = datetime.datetime(1970, 1, 1, 0, 0, 0)\n...\n>>> ormsgpack.packb(DatetimeEnum.EPOCH)\nb'\\xb31970-01-01T00:00:00'\n>>> ormsgpack.unpackb(_)\n'1970-01-01T00:00:00'\n>>> ormsgpack.packb(DatetimeEnum.EPOCH, option=ormsgpack.OPT_NAIVE_UTC)\nb'\\xb91970-01-01T00:00:00+00:00'\n>>> ormsgpack.unpackb(_)\n'1970-01-01T00:00:00+00:00'\n```\n\nEnums with members that are not supported types can be serialized using\n`default`:\n\n```python\n>>> import enum, ormsgpack\n>>> class Custom:\n... def __init__(self, val):\n... self.val = val\n...\n>>> def default(obj):\n... if isinstance(obj, Custom):\n... return obj.val\n... raise TypeError\n...\n>>> class CustomEnum(enum.Enum):\n... ONE = Custom(1)\n...\n>>> ormsgpack.packb(CustomEnum.ONE, default=default)\nb'\\x01'\n>>> ormsgpack.unpackb(_)\n1\n```\n\n### float\n\normsgpack serializes and deserializes double precision floats with no loss of\nprecision and consistent rounding.\n\n### int\n\normsgpack serializes and deserializes 64-bit integers by default. The range\nsupported is a signed 64-bit integer's minimum (-9223372036854775807) to\nan unsigned 64-bit integer's maximum (18446744073709551615).\n\n### numpy\n\normsgpack natively serializes `numpy.ndarray` and individual\n`numpy.float64`, `numpy.float32`, `numpy.float16`,\n`numpy.int64`, `numpy.int32`, `numpy.int16`, `numpy.int8`,\n`numpy.uint64`, `numpy.uint32`, `numpy.uint16`, `numpy.uint8`,\n`numpy.uintp`, `numpy.intp`, `numpy.datetime64`, and `numpy.bool`\ninstances.\n\n`numpy.datetime64` instances are serialized as RFC 3339 strings.\n\normsgpack is faster than all compared libraries at serializing\nnumpy instances. Serializing numpy data requires specifying\n`option=ormsgpack.OPT_SERIALIZE_NUMPY`.\n\n```python\n>>> import ormsgpack, numpy\n>>> ormsgpack.packb(\n... numpy.array([[1, 2, 3], [4, 5, 6]]),\n... option=ormsgpack.OPT_SERIALIZE_NUMPY,\n... )\nb'\\x92\\x93\\x01\\x02\\x03\\x93\\x04\\x05\\x06'\n>>> ormsgpack.unpackb(_)\n[[1, 2, 3], [4, 5, 6]]\n```\n\nThe array must be a contiguous C array (`C_CONTIGUOUS`) and one of the\nsupported datatypes.\n\nIf an array is not a contiguous C array or contains an supported datatype,\normsgpack falls through to `default`. In `default`, `obj.tolist()` can be\nspecified. If an array is malformed, which is not expected,\n`ormsgpack.MsgpackEncodeError` is raised.\n\n#### Performance\n![alt text](doc/numpy_float64.svg \"numpy\")\n![alt text](doc/numpy_int8.svg \"numpy int8\")\n![alt text](doc/numpy_int32.svg \"numpy int32\")\n![alt text](doc/numpy_npbool.svg \"numpy npbool\")\n![alt text](doc/numpy_uint8.svg \"numpy uint8\")\n```\n---------------------------------------------------------------------------------- benchmark 'numpy float64': 2 tests ---------------------------------------------------------------------------------\nName (time in ms) Min Max Mean StdDev Median IQR Outliers OPS Rounds Iterations\n-------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------\ntest_numpy_ormsgpack[float64] 77.9625 (1.0) 85.2507 (1.0) 79.0326 (1.0) 1.9043 (1.0) 78.5505 (1.0) 0.7408 (1.0) 1;1 12.6530 (1.0) 13 1\ntest_numpy_msgpack[float64] 511.5176 (6.56) 606.9395 (7.12) 559.0017 (7.07) 44.0661 (23.14) 572.5499 (7.29) 81.2972 (109.75) 3;0 1.7889 (0.14) 5 1\n-------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------\n\n\n------------------------------------------------------------------------------------- benchmark 'numpy int32': 2 tests -------------------------------------------------------------------------------------\nName (time in ms) Min Max Mean StdDev Median IQR Outliers OPS Rounds Iterations\n------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------\ntest_numpy_ormsgpack[int32] 197.8751 (1.0) 210.3111 (1.0) 201.1033 (1.0) 5.1886 (1.0) 198.8518 (1.0) 3.8297 (1.0) 1;1 4.9726 (1.0) 5 1\ntest_numpy_msgpack[int32] 1,363.8515 (6.89) 1,505.4747 (7.16) 1,428.2127 (7.10) 53.4176 (10.30) 1,425.3516 (7.17) 72.8064 (19.01) 2;0 0.7002 (0.14) 5 1\n------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------\n\n\n-------------------------------------------------------------------------------- benchmark 'numpy int8': 2 tests ---------------------------------------------------------------------------------\nName (time in ms) Min Max Mean StdDev Median IQR Outliers OPS Rounds Iterations\n--------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------\ntest_numpy_ormsgpack[int8] 107.8013 (1.0) 113.7336 (1.0) 109.0364 (1.0) 1.7805 (1.0) 108.3574 (1.0) 0.4066 (1.0) 1;2 9.1712 (1.0) 10 1\ntest_numpy_msgpack[int8] 685.4149 (6.36) 703.2958 (6.18) 693.2396 (6.36) 7.9572 (4.47) 691.5435 (6.38) 14.4142 (35.45) 1;0 1.4425 (0.16) 5 1\n--------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------\n\n\n------------------------------------------------------------------------------------- benchmark 'numpy npbool': 2 tests --------------------------------------------------------------------------------------\nName (time in ms) Min Max Mean StdDev Median IQR Outliers OPS Rounds Iterations\n--------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------\ntest_numpy_ormsgpack[npbool] 87.9005 (1.0) 89.5460 (1.0) 88.7928 (1.0) 0.5098 (1.0) 88.8508 (1.0) 0.6609 (1.0) 4;0 11.2622 (1.0) 12 1\ntest_numpy_msgpack[npbool] 1,095.0599 (12.46) 1,176.3442 (13.14) 1,120.5916 (12.62) 32.9993 (64.73) 1,110.4216 (12.50) 38.4189 (58.13) 1;0 0.8924 (0.08) 5 1\n--------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------\n\n\n--------------------------------------------------------------------------------- benchmark 'numpy uint8': 2 tests ---------------------------------------------------------------------------------\nName (time in ms) Min Max Mean StdDev Median IQR Outliers OPS Rounds Iterations\n----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------\ntest_numpy_ormsgpack[uint8] 133.1743 (1.0) 134.7246 (1.0) 134.2793 (1.0) 0.4946 (1.0) 134.3120 (1.0) 0.4492 (1.0) 1;1 7.4472 (1.0) 8 1\ntest_numpy_msgpack[uint8] 727.1393 (5.46) 824.8247 (6.12) 775.7032 (5.78) 34.9887 (70.73) 775.9595 (5.78) 36.2824 (80.78) 2;0 1.2892 (0.17) 5 1\n----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------\n```\n\n### uuid\n\normsgpack serializes `uuid.UUID` instances to\n[RFC 4122](https://tools.ietf.org/html/rfc4122) format, e.g.,\n\"f81d4fae-7dec-11d0-a765-00a0c91e6bf6\".\n\n```python\n>>> import ormsgpack, uuid\n>>> ormsgpack.packb(uuid.UUID('f81d4fae-7dec-11d0-a765-00a0c91e6bf6'))\nb'\\xd9$f81d4fae-7dec-11d0-a765-00a0c91e6bf6'\n>>> ormsgpack.unpackb(_)\n'f81d4fae-7dec-11d0-a765-00a0c91e6bf6'\n>>> ormsgpack.packb(uuid.uuid5(uuid.NAMESPACE_DNS, \"python.org\"))\nb'\\xd9$886313e1-3b8a-5372-9b90-0c9aee199e5d'\n>>> ormsgpack.unpackb(_)\n'886313e1-3b8a-5372-9b90-0c9aee199e5d\n```\n\n### Pydantic\normsgpack serializes `pydantic.BaseModel` instances natively, with\n[duck-typing](https://docs.pydantic.dev/2.10/concepts/serialization/#serializing-with-duck-typing).\nThis is equivalent to serializing\n`model.model_dump(serialize_as_any=True)` with Pydantic V2 or\n`model.dict()`with Pydantic V1.\n\n#### Performance\n![alt text](doc/pydantic.svg \"pydantic\")\n\n```\n-------------------------------------------------------------------------------- benchmark 'pydantic': 2 tests ---------------------------------------------------------------------------------\nName (time in ms) Min Max Mean StdDev Median IQR Outliers OPS Rounds Iterations\n------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------\ntest_pydantic_ormsgpack 4.3918 (1.0) 12.6521 (1.0) 4.8550 (1.0) 1.1455 (3.98) 4.6101 (1.0) 0.0662 (1.0) 11;24 205.9727 (1.0) 204 1\ntest_pydantic_msgpack 124.5500 (28.36) 125.5427 (9.92) 125.0582 (25.76) 0.2877 (1.0) 125.0855 (27.13) 0.2543 (3.84) 2;0 7.9963 (0.04) 8 1\n------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------\n```\n\n## Latency\n### Graphs\n![alt text](doc/twitter_packb.svg \"twitter.json serialization\")\n![alt text](doc/twitter_unpackb.svg \"twitter.json deserialization\")\n![alt text](doc/github_packb.svg \"github.json serialization\")\n![alt text](doc/github_unpackb.svg \"github.json deserialization\")\n![alt text](doc/citm_catalog_packb.svg \"citm_catalog.json serialization\")\n![alt text](doc/citm_catalog_unpackb.svg \"citm_catalog.json deserialization\")\n![alt text](doc/canada_packb.svg \"canada.json serialization\")\n![alt text](doc/canada_unpackb.svg \"canada.json deserialization\")\n### Data\n```\n----------------------------------------------------------------------------- benchmark 'canada packb': 2 tests ------------------------------------------------------------------------------\nName (time in ms) Min Max Mean StdDev Median IQR Outliers OPS Rounds Iterations\n----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------\ntest_ormsgpack_packb[canada] 3.5302 (1.0) 3.8939 (1.0) 3.7319 (1.0) 0.0563 (1.0) 3.7395 (1.0) 0.0484 (1.0) 56;22 267.9571 (1.0) 241 1\ntest_msgpack_packb[canada] 8.8642 (2.51) 14.0432 (3.61) 9.3660 (2.51) 0.5649 (10.03) 9.2983 (2.49) 0.0982 (2.03) 3;11 106.7691 (0.40) 106 1\n----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------\n\n\n------------------------------------------------------------------------------- benchmark 'canada unpackb': 2 tests --------------------------------------------------------------------------------\nName (time in ms) Min Max Mean StdDev Median IQR Outliers OPS Rounds Iterations\n----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------\ntest_msgpack_unpackb[canada] 10.1176 (1.0) 62.0466 (1.18) 33.4806 (1.0) 18.8279 (1.0) 46.6582 (1.0) 38.5921 (1.02) 30;0 29.8680 (1.0) 67 1\ntest_ormsgpack_unpackb[canada] 11.3992 (1.13) 52.6587 (1.0) 34.1842 (1.02) 18.9461 (1.01) 47.6456 (1.02) 37.8024 (1.0) 8;0 29.2533 (0.98) 20 1\n----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------\n\n\n----------------------------------------------------------------------------- benchmark 'citm_catalog packb': 2 tests -----------------------------------------------------------------------------\nName (time in ms) Min Max Mean StdDev Median IQR Outliers OPS Rounds Iterations\n---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------\ntest_ormsgpack_packb[citm_catalog] 1.8024 (1.0) 2.1259 (1.0) 1.9487 (1.0) 0.0346 (1.0) 1.9525 (1.0) 0.0219 (1.0) 79;60 513.1650 (1.0) 454 1\ntest_msgpack_packb[citm_catalog] 3.4195 (1.90) 3.8128 (1.79) 3.6928 (1.90) 0.0535 (1.55) 3.7009 (1.90) 0.0250 (1.14) 47;49 270.7958 (0.53) 257 1\n---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------\n\n\n------------------------------------------------------------------------------ benchmark 'citm_catalog unpackb': 2 tests ------------------------------------------------------------------------------\nName (time in ms) Min Max Mean StdDev Median IQR Outliers OPS Rounds Iterations\n-------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------\ntest_ormsgpack_unpackb[citm_catalog] 5.6986 (1.0) 46.1843 (1.0) 14.2491 (1.0) 15.9791 (1.0) 6.1051 (1.0) 0.3074 (1.0) 5;5 70.1798 (1.0) 23 1\ntest_msgpack_unpackb[citm_catalog] 7.2600 (1.27) 56.6642 (1.23) 16.4095 (1.15) 16.3257 (1.02) 7.7364 (1.27) 0.4944 (1.61) 28;29 60.9404 (0.87) 125 1\n-------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------\n\n\n----------------------------------------------------------------------------------- benchmark 'github packb': 2 tests -----------------------------------------------------------------------------------\nName (time in us) Min Max Mean StdDev Median IQR Outliers OPS (Kops/s) Rounds Iterations\n---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------\ntest_ormsgpack_packb[github] 73.0000 (1.0) 215.9000 (1.0) 80.4826 (1.0) 4.8889 (1.0) 80.3000 (1.0) 1.1000 (1.83) 866;1118 12.4250 (1.0) 6196 1\ntest_msgpack_packb[github] 103.8000 (1.42) 220.8000 (1.02) 112.8049 (1.40) 4.9686 (1.02) 113.0000 (1.41) 0.6000 (1.0) 1306;1560 8.8649 (0.71) 7028 1\n---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------\n\n\n----------------------------------------------------------------------------------- benchmark 'github unpackb': 2 tests -----------------------------------------------------------------------------------\nName (time in us) Min Max Mean StdDev Median IQR Outliers OPS (Kops/s) Rounds Iterations\n-----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------\ntest_ormsgpack_unpackb[github] 201.3000 (1.0) 318.5000 (1.0) 219.0861 (1.0) 6.7340 (1.0) 219.1000 (1.0) 1.2000 (1.0) 483;721 4.5644 (1.0) 3488 1\ntest_msgpack_unpackb[github] 289.8000 (1.44) 436.0000 (1.37) 314.9631 (1.44) 9.4130 (1.40) 315.1000 (1.44) 2.3000 (1.92) 341;557 3.1750 (0.70) 2477 1\n-----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------\n\n--------------------------------------------------------------------------------------- benchmark 'twitter packb': 2 tests ---------------------------------------------------------------------------------------\nName (time in us) Min Max Mean StdDev Median IQR Outliers OPS Rounds Iterations\n------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------\ntest_ormsgpack_packb[twitter] 820.7000 (1.0) 2,945.2000 (2.03) 889.3791 (1.0) 78.4139 (2.43) 884.2000 (1.0) 12.5250 (1.0) 4;76 1,124.3799 (1.0) 809 1\ntest_msgpack_packb[twitter] 1,209.3000 (1.47) 1,451.2000 (1.0) 1,301.3615 (1.46) 32.2147 (1.0) 1,306.7000 (1.48) 14.1000 (1.13) 118;138 768.4260 (0.68) 592 1\n------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------\n\n\n------------------------------------------------------------------------------ benchmark 'twitter unpackb': 2 tests -----------------------------------------------------------------------------\nName (time in ms) Min Max Mean StdDev Median IQR Outliers OPS Rounds Iterations\n-------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------\ntest_ormsgpack_unpackb[twitter] 2.7097 (1.0) 41.1530 (1.0) 3.2721 (1.0) 3.5860 (1.03) 2.8868 (1.0) 0.0614 (1.32) 4;38 305.6098 (1.0) 314 1\ntest_msgpack_unpackb[twitter] 3.8079 (1.41) 42.0617 (1.02) 4.4459 (1.36) 3.4893 (1.0) 4.1097 (1.42) 0.0465 (1.0) 2;54 224.9267 (0.74) 228 1\n-------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------\n```\n### Reproducing\n\nThe above was measured using Python 3.7.9 on Azure Linux VM (x86_64) with ormsgpack 0.2.1 and msgpack 1.0.2.\n\nThe latency results can be reproduced using `./scripts/benchmark.sh` and graphs using\n`pytest --benchmark-histogram benchmarks/bench_*`.\n## Questions\n\n### Why can't I install it from PyPI?\n\nProbably `pip` needs to be upgraded to version 20.3 or later to support\nthe latest manylinux_x_y or universal2 wheel formats.\n\n### Will it deserialize to dataclasses, UUIDs, decimals, etc or support object_hook?\n\nNo. This requires a schema specifying what types are expected and how to\nhandle errors etc. This is addressed by data validation libraries a\nlevel above this.\n\n## Packaging\n\nTo package ormsgpack requires [Rust](https://www.rust-lang.org/) 1.70\nor newer and the [maturin](https://github.com/PyO3/maturin) build\ntool. The default feature `unstable-simd` enables the usage of SIMD\noperations and requires nightly Rust. The recommended build command\nis:\n\n```sh\nmaturin build --release --strip\n```\n\normsgpack is tested on Linux/amd64, Linux/aarch64, Linux/armv7, macOS/amd64 and Windows/amd64.\n\nThere are no runtime dependencies other than libc.\n\n## License\n\norjson was written by ijl <<ijl@mailbox.org>>, copyright 2018 - 2021, licensed\nunder both the Apache 2 and MIT licenses.\n\normsgpack was forked from orjson by Aviram Hassan and is now maintained by Emanuele Giaquinta (@exg), licensed\nsame as orjson.\n\n",
"bugtrack_url": null,
"license": "Apache-2.0 OR MIT",
"summary": "Fast, correct Python msgpack library supporting dataclasses, datetimes, and numpy",
"version": "1.7.0",
"project_urls": {
"Homepage": "https://github.com/aviramha/ormsgpack",
"Source Code": "https://github.com/aviramha/ormsgpack"
},
"split_keywords": [
"fast",
" msgpack",
" dataclass",
" dataclasses",
" datetime"
],
"urls": [
{
"comment_text": "",
"digests": {
"blake2b_256": "e685f1b58b9856b136d37c988270a4b5404628d334695f5dc6402e6b632be7df",
"md5": "34afdaab81c4cb28cf77bfff41300117",
"sha256": "a0ca6a64d47073f22ecc1dd96b384e44f98796d3f88ee383e92dfbcdf18c2efd"
},
"downloads": -1,
"filename": "ormsgpack-1.7.0-cp310-cp310-macosx_10_12_x86_64.macosx_11_0_arm64.macosx_10_12_universal2.whl",
"has_sig": false,
"md5_digest": "34afdaab81c4cb28cf77bfff41300117",
"packagetype": "bdist_wheel",
"python_version": "cp310",
"requires_python": ">=3.9",
"size": 383796,
"upload_time": "2024-12-08T17:43:25",
"upload_time_iso_8601": "2024-12-08T17:43:25.046940Z",
"url": "https://files.pythonhosted.org/packages/e6/85/f1b58b9856b136d37c988270a4b5404628d334695f5dc6402e6b632be7df/ormsgpack-1.7.0-cp310-cp310-macosx_10_12_x86_64.macosx_11_0_arm64.macosx_10_12_universal2.whl",
"yanked": false,
"yanked_reason": null
},
{
"comment_text": "",
"digests": {
"blake2b_256": "97077ddf994123b4553c3ef8adc73d02c51b3283becb5ddf1ac998a5ae22109f",
"md5": "2ab2cc354158cd6fe27b42bc8fd9a3e1",
"sha256": "e8385181bf195af80fc270e64fd477f1c414ffb05837320382e2ec9ca34be0ec"
},
"downloads": -1,
"filename": "ormsgpack-1.7.0-cp310-cp310-manylinux_2_17_aarch64.manylinux2014_aarch64.whl",
"has_sig": false,
"md5_digest": "2ab2cc354158cd6fe27b42bc8fd9a3e1",
"packagetype": "bdist_wheel",
"python_version": "cp310",
"requires_python": ">=3.9",
"size": 209426,
"upload_time": "2024-12-08T17:43:26",
"upload_time_iso_8601": "2024-12-08T17:43:26.778630Z",
"url": "https://files.pythonhosted.org/packages/97/07/7ddf994123b4553c3ef8adc73d02c51b3283becb5ddf1ac998a5ae22109f/ormsgpack-1.7.0-cp310-cp310-manylinux_2_17_aarch64.manylinux2014_aarch64.whl",
"yanked": false,
"yanked_reason": null
},
{
"comment_text": "",
"digests": {
"blake2b_256": "dd14e8b42e5f0be3be70063a79f3c50b06a748de3029c20e49fc0af60901e1d7",
"md5": "a4455355c692ea6f6619e5826a5b4d42",
"sha256": "ca4d35b694f32112eb33ac0b733cb903dbbc59f019d05ca3d74f6ad2f587b0bf"
},
"downloads": -1,
"filename": "ormsgpack-1.7.0-cp310-cp310-manylinux_2_17_armv7l.manylinux2014_armv7l.whl",
"has_sig": false,
"md5_digest": "a4455355c692ea6f6619e5826a5b4d42",
"packagetype": "bdist_wheel",
"python_version": "cp310",
"requires_python": ">=3.9",
"size": 216033,
"upload_time": "2024-12-08T17:43:28",
"upload_time_iso_8601": "2024-12-08T17:43:28.035143Z",
"url": "https://files.pythonhosted.org/packages/dd/14/e8b42e5f0be3be70063a79f3c50b06a748de3029c20e49fc0af60901e1d7/ormsgpack-1.7.0-cp310-cp310-manylinux_2_17_armv7l.manylinux2014_armv7l.whl",
"yanked": false,
"yanked_reason": null
},
{
"comment_text": "",
"digests": {
"blake2b_256": "450977c3cabe63f67eefeb850d17c8e5ba71579b8d72976486dee91a0aa6c427",
"md5": "a88b5fe241e561be5f64df5915200a57",
"sha256": "e86124cdbc8ed249806347c2fba96843e8941122b161b429139a0c973d270de4"
},
"downloads": -1,
"filename": "ormsgpack-1.7.0-cp310-cp310-manylinux_2_17_x86_64.manylinux2014_x86_64.whl",
"has_sig": false,
"md5_digest": "a88b5fe241e561be5f64df5915200a57",
"packagetype": "bdist_wheel",
"python_version": "cp310",
"requires_python": ">=3.9",
"size": 220618,
"upload_time": "2024-12-08T17:43:29",
"upload_time_iso_8601": "2024-12-08T17:43:29.877273Z",
"url": "https://files.pythonhosted.org/packages/45/09/77c3cabe63f67eefeb850d17c8e5ba71579b8d72976486dee91a0aa6c427/ormsgpack-1.7.0-cp310-cp310-manylinux_2_17_x86_64.manylinux2014_x86_64.whl",
"yanked": false,
"yanked_reason": null
},
{
"comment_text": "",
"digests": {
"blake2b_256": "b51e5c727d2d48bb34b95b783bba155e49aff8c920b3fbb634c24914e0be3684",
"md5": "ac06917496cb8fe95866deae605ed781",
"sha256": "6d114652dadd81802b8a35a49e07a3e9ef2a47aed6123fb5031f2220d1c8e434"
},
"downloads": -1,
"filename": "ormsgpack-1.7.0-cp310-cp310-win_amd64.whl",
"has_sig": false,
"md5_digest": "ac06917496cb8fe95866deae605ed781",
"packagetype": "bdist_wheel",
"python_version": "cp310",
"requires_python": ">=3.9",
"size": 125199,
"upload_time": "2024-12-08T17:43:31",
"upload_time_iso_8601": "2024-12-08T17:43:31.109917Z",
"url": "https://files.pythonhosted.org/packages/b5/1e/5c727d2d48bb34b95b783bba155e49aff8c920b3fbb634c24914e0be3684/ormsgpack-1.7.0-cp310-cp310-win_amd64.whl",
"yanked": false,
"yanked_reason": null
},
{
"comment_text": "",
"digests": {
"blake2b_256": "db0255d7c1b8040b26096189e001cd9b6dbc627c09440b82600480284812c966",
"md5": "06fe5dcccdf625d5efa77f9e16e0bf2d",
"sha256": "2c22c62a6bc93bcb194b7f91864ca0b39455b2cbbfc1538a3da0f9ec3c11d184"
},
"downloads": -1,
"filename": "ormsgpack-1.7.0-cp311-cp311-macosx_10_12_x86_64.macosx_11_0_arm64.macosx_10_12_universal2.whl",
"has_sig": false,
"md5_digest": "06fe5dcccdf625d5efa77f9e16e0bf2d",
"packagetype": "bdist_wheel",
"python_version": "cp311",
"requires_python": ">=3.9",
"size": 383797,
"upload_time": "2024-12-08T17:43:32",
"upload_time_iso_8601": "2024-12-08T17:43:32.828564Z",
"url": "https://files.pythonhosted.org/packages/db/02/55d7c1b8040b26096189e001cd9b6dbc627c09440b82600480284812c966/ormsgpack-1.7.0-cp311-cp311-macosx_10_12_x86_64.macosx_11_0_arm64.macosx_10_12_universal2.whl",
"yanked": false,
"yanked_reason": null
},
{
"comment_text": "",
"digests": {
"blake2b_256": "ec2d16934d165fe85e6ce8349879082f6306f9ca3022f59660beca3a52571688",
"md5": "f06d4c90701bab10d0e55820f714a93d",
"sha256": "f9967a7f3647ad118751abf090f8397fda3e4bca6833340cab95a3f2bec598cd"
},
"downloads": -1,
"filename": "ormsgpack-1.7.0-cp311-cp311-manylinux_2_17_aarch64.manylinux2014_aarch64.whl",
"has_sig": false,
"md5_digest": "f06d4c90701bab10d0e55820f714a93d",
"packagetype": "bdist_wheel",
"python_version": "cp311",
"requires_python": ">=3.9",
"size": 209426,
"upload_time": "2024-12-08T17:43:34",
"upload_time_iso_8601": "2024-12-08T17:43:34.026002Z",
"url": "https://files.pythonhosted.org/packages/ec/2d/16934d165fe85e6ce8349879082f6306f9ca3022f59660beca3a52571688/ormsgpack-1.7.0-cp311-cp311-manylinux_2_17_aarch64.manylinux2014_aarch64.whl",
"yanked": false,
"yanked_reason": null
},
{
"comment_text": "",
"digests": {
"blake2b_256": "c6da56eebfce626e4929eaf84f5aa39fe012fa43f2d5c04dccf0748e0c2da9ef",
"md5": "070f7402d355c1735d6ddcc8347c4ea9",
"sha256": "91ebb7d3609db249cdff629ffef83ec3d025b1384749a297cf3b6a8240cf22ac"
},
"downloads": -1,
"filename": "ormsgpack-1.7.0-cp311-cp311-manylinux_2_17_armv7l.manylinux2014_armv7l.whl",
"has_sig": false,
"md5_digest": "070f7402d355c1735d6ddcc8347c4ea9",
"packagetype": "bdist_wheel",
"python_version": "cp311",
"requires_python": ">=3.9",
"size": 216033,
"upload_time": "2024-12-08T17:43:35",
"upload_time_iso_8601": "2024-12-08T17:43:35.820165Z",
"url": "https://files.pythonhosted.org/packages/c6/da/56eebfce626e4929eaf84f5aa39fe012fa43f2d5c04dccf0748e0c2da9ef/ormsgpack-1.7.0-cp311-cp311-manylinux_2_17_armv7l.manylinux2014_armv7l.whl",
"yanked": false,
"yanked_reason": null
},
{
"comment_text": "",
"digests": {
"blake2b_256": "a43c65fabc7f86d48e4a049a9e360829e0c67a8ee3cb23357c21ddf976b59e68",
"md5": "a732b33eea3f1cc612d5467e4a23fb22",
"sha256": "c683071bf4527ffa7b6cfcf28f750d1a82eb77846d106743c09261ab1b79b193"
},
"downloads": -1,
"filename": "ormsgpack-1.7.0-cp311-cp311-manylinux_2_17_x86_64.manylinux2014_x86_64.whl",
"has_sig": false,
"md5_digest": "a732b33eea3f1cc612d5467e4a23fb22",
"packagetype": "bdist_wheel",
"python_version": "cp311",
"requires_python": ">=3.9",
"size": 220619,
"upload_time": "2024-12-08T17:43:37",
"upload_time_iso_8601": "2024-12-08T17:43:37.151999Z",
"url": "https://files.pythonhosted.org/packages/a4/3c/65fabc7f86d48e4a049a9e360829e0c67a8ee3cb23357c21ddf976b59e68/ormsgpack-1.7.0-cp311-cp311-manylinux_2_17_x86_64.manylinux2014_x86_64.whl",
"yanked": false,
"yanked_reason": null
},
{
"comment_text": "",
"digests": {
"blake2b_256": "ee0587694d846e487b57a2f448bac635ce87e6253e1ad08a01d7eec19f13396a",
"md5": "ec8ed363563746033a73de4ba3b02539",
"sha256": "90aabfd816db60dadab1100d583d061e0238209015bf684f8170c0fca4eb445a"
},
"downloads": -1,
"filename": "ormsgpack-1.7.0-cp311-cp311-win_amd64.whl",
"has_sig": false,
"md5_digest": "ec8ed363563746033a73de4ba3b02539",
"packagetype": "bdist_wheel",
"python_version": "cp311",
"requires_python": ">=3.9",
"size": 125199,
"upload_time": "2024-12-08T17:43:38",
"upload_time_iso_8601": "2024-12-08T17:43:38.937436Z",
"url": "https://files.pythonhosted.org/packages/ee/05/87694d846e487b57a2f448bac635ce87e6253e1ad08a01d7eec19f13396a/ormsgpack-1.7.0-cp311-cp311-win_amd64.whl",
"yanked": false,
"yanked_reason": null
},
{
"comment_text": "",
"digests": {
"blake2b_256": "fcb1a48ace13ae2c32abbcc53596a691a3c9dcc88f1229dc4ead258d4ba2f55c",
"md5": "38231220dd39aca6e8027f9f4060fe6a",
"sha256": "77bc2ea387d85cfad045b9bcb8040bae43ad32dafe9363360f732cc19d489bbe"
},
"downloads": -1,
"filename": "ormsgpack-1.7.0-cp312-cp312-macosx_10_12_x86_64.macosx_11_0_arm64.macosx_10_12_universal2.whl",
"has_sig": false,
"md5_digest": "38231220dd39aca6e8027f9f4060fe6a",
"packagetype": "bdist_wheel",
"python_version": "cp312",
"requires_python": ">=3.9",
"size": 384428,
"upload_time": "2024-12-08T17:43:40",
"upload_time_iso_8601": "2024-12-08T17:43:40.721298Z",
"url": "https://files.pythonhosted.org/packages/fc/b1/a48ace13ae2c32abbcc53596a691a3c9dcc88f1229dc4ead258d4ba2f55c/ormsgpack-1.7.0-cp312-cp312-macosx_10_12_x86_64.macosx_11_0_arm64.macosx_10_12_universal2.whl",
"yanked": false,
"yanked_reason": null
},
{
"comment_text": "",
"digests": {
"blake2b_256": "7228df2576518f1d11d8c05b24ab3744ee86b41439eeed05e86ab79f3cafd9cc",
"md5": "1400701bac48d1f445eef3e9cfc258d7",
"sha256": "5ec763096d978d35eedcef0af13991a10741717c2e236b26f4c2047b0740ea7b"
},
"downloads": -1,
"filename": "ormsgpack-1.7.0-cp312-cp312-manylinux_2_17_aarch64.manylinux2014_aarch64.whl",
"has_sig": false,
"md5_digest": "1400701bac48d1f445eef3e9cfc258d7",
"packagetype": "bdist_wheel",
"python_version": "cp312",
"requires_python": ">=3.9",
"size": 209563,
"upload_time": "2024-12-08T17:43:42",
"upload_time_iso_8601": "2024-12-08T17:43:42.706813Z",
"url": "https://files.pythonhosted.org/packages/72/28/df2576518f1d11d8c05b24ab3744ee86b41439eeed05e86ab79f3cafd9cc/ormsgpack-1.7.0-cp312-cp312-manylinux_2_17_aarch64.manylinux2014_aarch64.whl",
"yanked": false,
"yanked_reason": null
},
{
"comment_text": "",
"digests": {
"blake2b_256": "a1bd44fcaa665a8340aea65db360f15e2090f834899e7acb88dacc91b5050e9d",
"md5": "36070446728ebfc2639a58e85c51c888",
"sha256": "22418a4d399027a72fb2e6b873559b1886cf2e63323ca7afc17b222c454413b7"
},
"downloads": -1,
"filename": "ormsgpack-1.7.0-cp312-cp312-manylinux_2_17_armv7l.manylinux2014_armv7l.whl",
"has_sig": false,
"md5_digest": "36070446728ebfc2639a58e85c51c888",
"packagetype": "bdist_wheel",
"python_version": "cp312",
"requires_python": ">=3.9",
"size": 216208,
"upload_time": "2024-12-08T17:43:43",
"upload_time_iso_8601": "2024-12-08T17:43:43.864062Z",
"url": "https://files.pythonhosted.org/packages/a1/bd/44fcaa665a8340aea65db360f15e2090f834899e7acb88dacc91b5050e9d/ormsgpack-1.7.0-cp312-cp312-manylinux_2_17_armv7l.manylinux2014_armv7l.whl",
"yanked": false,
"yanked_reason": null
},
{
"comment_text": "",
"digests": {
"blake2b_256": "bd458c0269fde9dd4b04f07fdeb025f60e93ceeebb70911775e0263e6884e956",
"md5": "286d3389f342d71a19e60c9597e89bb6",
"sha256": "97723786755a7df85fcf6e68d7b5359dacea98d5c26b1d9af219a3cc05df4734"
},
"downloads": -1,
"filename": "ormsgpack-1.7.0-cp312-cp312-manylinux_2_17_x86_64.manylinux2014_x86_64.whl",
"has_sig": false,
"md5_digest": "286d3389f342d71a19e60c9597e89bb6",
"packagetype": "bdist_wheel",
"python_version": "cp312",
"requires_python": ">=3.9",
"size": 220950,
"upload_time": "2024-12-08T17:43:45",
"upload_time_iso_8601": "2024-12-08T17:43:45.103863Z",
"url": "https://files.pythonhosted.org/packages/bd/45/8c0269fde9dd4b04f07fdeb025f60e93ceeebb70911775e0263e6884e956/ormsgpack-1.7.0-cp312-cp312-manylinux_2_17_x86_64.manylinux2014_x86_64.whl",
"yanked": false,
"yanked_reason": null
},
{
"comment_text": "",
"digests": {
"blake2b_256": "c638ffbdf3936ca4976fb6dea597cccbcfb971bf22cd3175bac601d467ec474a",
"md5": "2df46158cd8791af775da7095e5a9966",
"sha256": "7e6ada21f5c7a20ff7cf9b061c44e3814352f819947a12022ad8cb52a9f2a809"
},
"downloads": -1,
"filename": "ormsgpack-1.7.0-cp312-cp312-win_amd64.whl",
"has_sig": false,
"md5_digest": "2df46158cd8791af775da7095e5a9966",
"packagetype": "bdist_wheel",
"python_version": "cp312",
"requires_python": ">=3.9",
"size": 125646,
"upload_time": "2024-12-08T17:43:46",
"upload_time_iso_8601": "2024-12-08T17:43:46.392611Z",
"url": "https://files.pythonhosted.org/packages/c6/38/ffbdf3936ca4976fb6dea597cccbcfb971bf22cd3175bac601d467ec474a/ormsgpack-1.7.0-cp312-cp312-win_amd64.whl",
"yanked": false,
"yanked_reason": null
},
{
"comment_text": "",
"digests": {
"blake2b_256": "96446de76ed10d506c156854f441ee5ba070ce0613650545d09446dfe38b9922",
"md5": "6b33dff3eb0cd394cbe691956799731c",
"sha256": "462089a419dbde654915ccb0b859c0dbe3c178b0ac580018e82befea6ccd73f4"
},
"downloads": -1,
"filename": "ormsgpack-1.7.0-cp313-cp313-macosx_10_12_x86_64.macosx_11_0_arm64.macosx_10_12_universal2.whl",
"has_sig": false,
"md5_digest": "6b33dff3eb0cd394cbe691956799731c",
"packagetype": "bdist_wheel",
"python_version": "cp313",
"requires_python": ">=3.9",
"size": 384425,
"upload_time": "2024-12-08T17:43:47",
"upload_time_iso_8601": "2024-12-08T17:43:47.496112Z",
"url": "https://files.pythonhosted.org/packages/96/44/6de76ed10d506c156854f441ee5ba070ce0613650545d09446dfe38b9922/ormsgpack-1.7.0-cp313-cp313-macosx_10_12_x86_64.macosx_11_0_arm64.macosx_10_12_universal2.whl",
"yanked": false,
"yanked_reason": null
},
{
"comment_text": "",
"digests": {
"blake2b_256": "3a484def290afde367f40bda418df7283b555f6a0a3f54ff1b18d48e6fdf2a43",
"md5": "d9a68f0221dc7a926462b78ef91a9ade",
"sha256": "4b353204e99b56c1d33f1cf4767bd1fe1195596181a1cc789f25aa26c0b50f3d"
},
"downloads": -1,
"filename": "ormsgpack-1.7.0-cp313-cp313-manylinux_2_17_aarch64.manylinux2014_aarch64.whl",
"has_sig": false,
"md5_digest": "d9a68f0221dc7a926462b78ef91a9ade",
"packagetype": "bdist_wheel",
"python_version": "cp313",
"requires_python": ">=3.9",
"size": 209564,
"upload_time": "2024-12-08T17:43:48",
"upload_time_iso_8601": "2024-12-08T17:43:48.926912Z",
"url": "https://files.pythonhosted.org/packages/3a/48/4def290afde367f40bda418df7283b555f6a0a3f54ff1b18d48e6fdf2a43/ormsgpack-1.7.0-cp313-cp313-manylinux_2_17_aarch64.manylinux2014_aarch64.whl",
"yanked": false,
"yanked_reason": null
},
{
"comment_text": "",
"digests": {
"blake2b_256": "c86154d72fdd475e6269c517362aa825f451447b07ae6f687e2d436f430f3244",
"md5": "c117f79333618f6bf5c13d54d76f3ab4",
"sha256": "a5e12b51a590be47ccef67907905653e679fc2f920854b456edc216690ecc09c"
},
"downloads": -1,
"filename": "ormsgpack-1.7.0-cp313-cp313-manylinux_2_17_armv7l.manylinux2014_armv7l.whl",
"has_sig": false,
"md5_digest": "c117f79333618f6bf5c13d54d76f3ab4",
"packagetype": "bdist_wheel",
"python_version": "cp313",
"requires_python": ">=3.9",
"size": 216208,
"upload_time": "2024-12-08T17:43:51",
"upload_time_iso_8601": "2024-12-08T17:43:51.013785Z",
"url": "https://files.pythonhosted.org/packages/c8/61/54d72fdd475e6269c517362aa825f451447b07ae6f687e2d436f430f3244/ormsgpack-1.7.0-cp313-cp313-manylinux_2_17_armv7l.manylinux2014_armv7l.whl",
"yanked": false,
"yanked_reason": null
},
{
"comment_text": "",
"digests": {
"blake2b_256": "551ea264a7b680fe901323f0c97df5986c0c7543b3d5fe82ba4df9e4b19118d3",
"md5": "b904a129048cc18822a7e19395b670f8",
"sha256": "3a6a97937d2cf21496d7689b90a43df83c5062bbe846aaa39197cc9ad73eaa7b"
},
"downloads": -1,
"filename": "ormsgpack-1.7.0-cp313-cp313-manylinux_2_17_x86_64.manylinux2014_x86_64.whl",
"has_sig": false,
"md5_digest": "b904a129048cc18822a7e19395b670f8",
"packagetype": "bdist_wheel",
"python_version": "cp313",
"requires_python": ">=3.9",
"size": 220950,
"upload_time": "2024-12-08T17:43:52",
"upload_time_iso_8601": "2024-12-08T17:43:52.920165Z",
"url": "https://files.pythonhosted.org/packages/55/1e/a264a7b680fe901323f0c97df5986c0c7543b3d5fe82ba4df9e4b19118d3/ormsgpack-1.7.0-cp313-cp313-manylinux_2_17_x86_64.manylinux2014_x86_64.whl",
"yanked": false,
"yanked_reason": null
},
{
"comment_text": "",
"digests": {
"blake2b_256": "5e9b378c1b209264e840294ecf97ea1f5cab05f3fc32bc5a1c79584ac5b06dc0",
"md5": "64a5ee78f7cd2c727ad0e76309e69c31",
"sha256": "8d301e47565fe0e52a60052e730a9bb7669dfbd2a94643b8be925e3928c64c15"
},
"downloads": -1,
"filename": "ormsgpack-1.7.0-cp313-cp313-win_amd64.whl",
"has_sig": false,
"md5_digest": "64a5ee78f7cd2c727ad0e76309e69c31",
"packagetype": "bdist_wheel",
"python_version": "cp313",
"requires_python": ">=3.9",
"size": 125645,
"upload_time": "2024-12-08T17:43:54",
"upload_time_iso_8601": "2024-12-08T17:43:54.761669Z",
"url": "https://files.pythonhosted.org/packages/5e/9b/378c1b209264e840294ecf97ea1f5cab05f3fc32bc5a1c79584ac5b06dc0/ormsgpack-1.7.0-cp313-cp313-win_amd64.whl",
"yanked": false,
"yanked_reason": null
},
{
"comment_text": "",
"digests": {
"blake2b_256": "b529d70ef5320096442b21172b2a37659b5070b0cdedaf77bfaa27bf61dec089",
"md5": "f469f9e4419002d304ff81ac525b0e77",
"sha256": "a8fbe7bb50ee8381df030823d9366984fac718447947c2327969405d1d799b95"
},
"downloads": -1,
"filename": "ormsgpack-1.7.0-cp39-cp39-macosx_10_12_x86_64.macosx_11_0_arm64.macosx_10_12_universal2.whl",
"has_sig": false,
"md5_digest": "f469f9e4419002d304ff81ac525b0e77",
"packagetype": "bdist_wheel",
"python_version": "cp39",
"requires_python": ">=3.9",
"size": 383811,
"upload_time": "2024-12-08T17:43:56",
"upload_time_iso_8601": "2024-12-08T17:43:56.008371Z",
"url": "https://files.pythonhosted.org/packages/b5/29/d70ef5320096442b21172b2a37659b5070b0cdedaf77bfaa27bf61dec089/ormsgpack-1.7.0-cp39-cp39-macosx_10_12_x86_64.macosx_11_0_arm64.macosx_10_12_universal2.whl",
"yanked": false,
"yanked_reason": null
},
{
"comment_text": "",
"digests": {
"blake2b_256": "1d3ba55899edf2bcd681db5b81b9712c829d3855923d091c4470532812d4e397",
"md5": "44c77c6026e01b1699349b3fde71fa1c",
"sha256": "5fefa1ca842dbba258401ea958113fe62c6b70a7a4d46edac440113f68dc431e"
},
"downloads": -1,
"filename": "ormsgpack-1.7.0-cp39-cp39-manylinux_2_17_aarch64.manylinux2014_aarch64.whl",
"has_sig": false,
"md5_digest": "44c77c6026e01b1699349b3fde71fa1c",
"packagetype": "bdist_wheel",
"python_version": "cp39",
"requires_python": ">=3.9",
"size": 209431,
"upload_time": "2024-12-08T17:43:57",
"upload_time_iso_8601": "2024-12-08T17:43:57.732090Z",
"url": "https://files.pythonhosted.org/packages/1d/3b/a55899edf2bcd681db5b81b9712c829d3855923d091c4470532812d4e397/ormsgpack-1.7.0-cp39-cp39-manylinux_2_17_aarch64.manylinux2014_aarch64.whl",
"yanked": false,
"yanked_reason": null
},
{
"comment_text": "",
"digests": {
"blake2b_256": "35d4d62541deff3a20fe8c655ff8dd065268bd1a01b21e6c83bbdb1c6c68c4e3",
"md5": "bd848dc190777790281f4fc9c1cf474c",
"sha256": "9b0945523ccc75aa6907f38f2240d36818618baccb8633923bd7740a5a929e67"
},
"downloads": -1,
"filename": "ormsgpack-1.7.0-cp39-cp39-manylinux_2_17_armv7l.manylinux2014_armv7l.whl",
"has_sig": false,
"md5_digest": "bd848dc190777790281f4fc9c1cf474c",
"packagetype": "bdist_wheel",
"python_version": "cp39",
"requires_python": ">=3.9",
"size": 216029,
"upload_time": "2024-12-08T17:43:58",
"upload_time_iso_8601": "2024-12-08T17:43:58.969468Z",
"url": "https://files.pythonhosted.org/packages/35/d4/d62541deff3a20fe8c655ff8dd065268bd1a01b21e6c83bbdb1c6c68c4e3/ormsgpack-1.7.0-cp39-cp39-manylinux_2_17_armv7l.manylinux2014_armv7l.whl",
"yanked": false,
"yanked_reason": null
},
{
"comment_text": "",
"digests": {
"blake2b_256": "9f0569a8e27c90e864062cfc8cad8ad703810e6eb86737f1d88c6414b0aa9700",
"md5": "1e16954ad4611a1de1fc82a5adbdefe8",
"sha256": "65525438b4a8b3b64ccfcda25e758ea3db392d1c206b5e09ef70efbbafa6dbf9"
},
"downloads": -1,
"filename": "ormsgpack-1.7.0-cp39-cp39-manylinux_2_17_x86_64.manylinux2014_x86_64.whl",
"has_sig": false,
"md5_digest": "1e16954ad4611a1de1fc82a5adbdefe8",
"packagetype": "bdist_wheel",
"python_version": "cp39",
"requires_python": ">=3.9",
"size": 220617,
"upload_time": "2024-12-08T17:44:00",
"upload_time_iso_8601": "2024-12-08T17:44:00.107611Z",
"url": "https://files.pythonhosted.org/packages/9f/05/69a8e27c90e864062cfc8cad8ad703810e6eb86737f1d88c6414b0aa9700/ormsgpack-1.7.0-cp39-cp39-manylinux_2_17_x86_64.manylinux2014_x86_64.whl",
"yanked": false,
"yanked_reason": null
},
{
"comment_text": "",
"digests": {
"blake2b_256": "5f2d9085f96865adf59daedac1171c376eed4ffe25ff45363a13ce5a87ff6005",
"md5": "2886ebae2d6ee711dee4d3055f960665",
"sha256": "0d88307ab45d95416ce4071b1b99326ca31362af01c3d206f15a0551a7a874bd"
},
"downloads": -1,
"filename": "ormsgpack-1.7.0-cp39-cp39-win_amd64.whl",
"has_sig": false,
"md5_digest": "2886ebae2d6ee711dee4d3055f960665",
"packagetype": "bdist_wheel",
"python_version": "cp39",
"requires_python": ">=3.9",
"size": 125194,
"upload_time": "2024-12-08T17:44:01",
"upload_time_iso_8601": "2024-12-08T17:44:01.285748Z",
"url": "https://files.pythonhosted.org/packages/5f/2d/9085f96865adf59daedac1171c376eed4ffe25ff45363a13ce5a87ff6005/ormsgpack-1.7.0-cp39-cp39-win_amd64.whl",
"yanked": false,
"yanked_reason": null
},
{
"comment_text": "",
"digests": {
"blake2b_256": "7d4c562457de7aab8102c8505ac591ddfd117d554e0b31d7f1b88ca8ffed7703",
"md5": "61e545da3895c74db2dec1fc012e919a",
"sha256": "6b4c98839cb7fc2a212037d2258f3a22857155249eb293d45c45cb974cfba834"
},
"downloads": -1,
"filename": "ormsgpack-1.7.0.tar.gz",
"has_sig": false,
"md5_digest": "61e545da3895c74db2dec1fc012e919a",
"packagetype": "sdist",
"python_version": "source",
"requires_python": ">=3.9",
"size": 55320,
"upload_time": "2024-12-08T17:44:02",
"upload_time_iso_8601": "2024-12-08T17:44:02.441474Z",
"url": "https://files.pythonhosted.org/packages/7d/4c/562457de7aab8102c8505ac591ddfd117d554e0b31d7f1b88ca8ffed7703/ormsgpack-1.7.0.tar.gz",
"yanked": false,
"yanked_reason": null
}
],
"upload_time": "2024-12-08 17:44:02",
"github": true,
"gitlab": false,
"bitbucket": false,
"codeberg": false,
"github_user": "aviramha",
"github_project": "ormsgpack",
"travis_ci": false,
"coveralls": false,
"github_actions": true,
"requirements": [],
"lcname": "ormsgpack"
}