{"id":13495411,"url":"https://github.com/aviramha/ormsgpack","last_synced_at":"2025-05-14T16:15:13.205Z","repository":{"id":37816607,"uuid":"373971276","full_name":"aviramha/ormsgpack","owner":"aviramha","description":"Msgpack serialization/deserialization library for Python, written in Rust using PyO3. Reboot of orjson. msgpack.org[Python]","archived":false,"fork":false,"pushed_at":"2025-05-13T16:54:21.000Z","size":4629,"stargazers_count":310,"open_issues_count":3,"forks_count":22,"subscribers_count":4,"default_branch":"master","last_synced_at":"2025-05-13T17:58:06.605Z","etag":null,"topics":["dataclass","dataclasses","extension","fast","msgpack","numpy","orjson","pydantic","pyo3","python","rust"],"latest_commit_sha":null,"homepage":"","language":"Rust","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"apache-2.0","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/aviramha.png","metadata":{"files":{"readme":"README.md","changelog":"CHANGELOG.md","contributing":"CONTRIBUTING.md","funding":null,"license":"LICENSE-APACHE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null,"zenodo":null}},"created_at":"2021-06-04T22:20:07.000Z","updated_at":"2025-05-13T16:54:26.000Z","dependencies_parsed_at":"2023-12-15T07:27:26.015Z","dependency_job_id":"2e4aa0c5-c431-4419-bffe-c236e90c6231","html_url":"https://github.com/aviramha/ormsgpack","commit_stats":{"total_commits":716,"total_committers":23,"mean_commits":"31.130434782608695","dds":"0.44692737430167595","last_synced_commit":"5a10f28857befbc91d79c71487308bbade23c0ca"},"previous_names":[],"tags_count":32,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/aviramha%2Formsgpack","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/aviramha%2Formsgpack/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/aviramha%2Formsgpack/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/aviramha%2Formsgpack/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/aviramha","download_url":"https://codeload.github.com/aviramha/ormsgpack/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":254006527,"owners_count":21998451,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["dataclass","dataclasses","extension","fast","msgpack","numpy","orjson","pydantic","pyo3","python","rust"],"created_at":"2024-07-31T19:01:34.420Z","updated_at":"2025-05-14T16:15:13.185Z","avatar_url":"https://github.com/aviramha.png","language":"Rust","readme":"# 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\u003e=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\u003e\u003e\u003e import ormsgpack, datetime, numpy\n\u003e\u003e\u003e data = {\n...     \"type\": \"job\",\n...     \"created_at\": datetime.datetime(1970, 1, 1),\n...     \"status\": \"🆗\",\n...     \"payload\": numpy.array([[1, 2], [3, 4]]),\n... }\n\u003e\u003e\u003e 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\u003e\u003e\u003e ormsgpack.unpackb(_)\n{'type': 'job', 'created_at': '1970-01-01T00:00:00+00:00', 'status': '🆗', '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) -\u003e 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.\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\u003e\u003e\u003e import ormsgpack, decimal\n\u003e\u003e\u003e def default(obj):\n...     if isinstance(obj, decimal.Decimal):\n...         return str(obj)\n...     raise TypeError\n...\n\u003e\u003e\u003e ormsgpack.packb(decimal.Decimal(\"0.0842389659712649442845\"))\nTypeError: Type is not msgpack serializable: decimal.Decimal\n\u003e\u003e\u003e ormsgpack.packb(decimal.Decimal(\"0.0842389659712649442845\"), default=default)\nb'\\xb80.0842389659712649442845'\n\u003e\u003e\u003e 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\u003e\u003e\u003e import ormsgpack, decimal\n\u003e\u003e\u003e def default(obj):\n...     if isinstance(obj, decimal.Decimal):\n...         return str(obj)\n...\n\u003e\u003e\u003e ormsgpack.packb({\"set\":{1, 2}}, default=default)\nb'\\x81\\xa3set\\xc0'\n\u003e\u003e\u003e 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\u003e\u003e\u003e import ormsgpack, decimal\n\u003e\u003e\u003e def default(obj):\n...     if isinstance(obj, decimal.Decimal):\n...         return ormsgpack.Ext(0, str(obj).encode())\n...     raise TypeError\n...\n\u003e\u003e\u003e ormsgpack.packb(decimal.Decimal(\"0.0842389659712649442845\"), default=default)\nb'\\xc7\\x18\\x000.0842389659712649442845'\n```\n\n`default` can also be used to serialize some supported types to a custom\nformat by enabling the corresponding passthrough options.\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\u003e\u003e\u003e import ormsgpack, datetime\n\u003e\u003e\u003e ormsgpack.packb(\n...     datetime.datetime(1970, 1, 1, 0, 0, 0),\n... )\nb'\\xb31970-01-01T00:00:00'\n\u003e\u003e\u003e ormsgpack.unpackb(_)\n'1970-01-01T00:00:00'\n\u003e\u003e\u003e 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\u003e\u003e\u003e 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`dict` keys of unsupported types are not handled using `default` and\nresult in `MsgpackEncodeError` being raised.\n\n```python\n\u003e\u003e\u003e import ormsgpack, datetime, uuid\n\u003e\u003e\u003e 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\u003e\u003e\u003e ormsgpack.unpackb(_)\n{'7202d115-7ff3-4c81-a7c1-2a1f067b1ece': [1, 2, 3]}\n\u003e\u003e\u003e 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\u003e\u003e\u003e 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\u003e\u003e\u003e import ormsgpack, datetime\n\u003e\u003e\u003e ormsgpack.packb(\n...     datetime.datetime(1970, 1, 1, 0, 0, 0, 1),\n... )\nb'\\xba1970-01-01T00:00:00.000001'\n\u003e\u003e\u003e ormsgpack.unpackb(_)\n'1970-01-01T00:00:00.000001'\n\u003e\u003e\u003e 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\u003e\u003e\u003e ormsgpack.unpackb(_)\n'1970-01-01T00:00:00'\n```\n\n##### `OPT_PASSTHROUGH_BIG_INT`\n\nEnable passthrough of `int` instances smaller than -9223372036854775807 or\nlarger than 18446744073709551615 to `default`.\n\n```python\n\u003e\u003e\u003e import ormsgpack\n\u003e\u003e\u003e ormsgpack.packb(\n...     2**65,\n... )\nTypeError: Integer exceeds 64-bit range\n\u003e\u003e\u003e 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\u003e\u003e\u003e ormsgpack.unpackb(_)\n{'type': 'bigint', 'value': '36893488147419103232'}\n```\n\n##### `OPT_PASSTHROUGH_DATACLASS`\n\nEnable passthrough of `dataclasses.dataclass` instances to `default`.\n\n\n```python\n\u003e\u003e\u003e import ormsgpack, dataclasses\n\u003e\u003e\u003e @dataclasses.dataclass\n... class User:\n...     id: str\n...     name: str\n...     password: str\n...\n\u003e\u003e\u003e def default(obj):\n...     if isinstance(obj, User):\n...         return {\"id\": obj.id, \"name\": obj.name}\n...     raise TypeError\n...\n\u003e\u003e\u003e ormsgpack.packb(User(\"3b1\", \"asd\", \"zxc\"))\nb'\\x83\\xa2id\\xa33b1\\xa4name\\xa3asd\\xa8password\\xa3zxc'\n\u003e\u003e\u003e ormsgpack.packb(User(\"3b1\", \"asd\", \"zxc\"), option=ormsgpack.OPT_PASSTHROUGH_DATACLASS)\nTypeError: Type is not msgpack serializable: User\n\u003e\u003e\u003e 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\nEnable passthrough of `datetime.datetime`, `datetime.date`, and\n`datetime.time` instances to `default`.\n\n```python\n\u003e\u003e\u003e import ormsgpack, datetime\n\u003e\u003e\u003e 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\u003e\u003e\u003e ormsgpack.packb({\"created_at\": datetime.datetime(1970, 1, 1)})\nb'\\x81\\xaacreated_at\\xb31970-01-01T00:00:00'\n\u003e\u003e\u003e ormsgpack.packb({\"created_at\": datetime.datetime(1970, 1, 1)}, option=ormsgpack.OPT_PASSTHROUGH_DATETIME)\nTypeError: Type is not msgpack serializable: datetime.datetime\n\u003e\u003e\u003e 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\n##### `OPT_PASSTHROUGH_ENUM`\n\nEnable passthrough of `enum.Enum` instances to `default`.\n\n##### `OPT_PASSTHROUGH_SUBCLASS`\n\nEnable passthrough of subclasses of `str`, `int`, `dict` and `list` to\n`default`.\n\n```python\n\u003e\u003e\u003e import ormsgpack\n\u003e\u003e\u003e class Secret(str):\n...     pass\n...\n\u003e\u003e\u003e def default(obj):\n...     if isinstance(obj, Secret):\n...         return \"******\"\n...     raise TypeError\n...\n\u003e\u003e\u003e ormsgpack.packb(Secret(\"zxc\"))\nb'\\xa3zxc'\n\u003e\u003e\u003e ormsgpack.packb(Secret(\"zxc\"), option=ormsgpack.OPT_PASSTHROUGH_SUBCLASS)\nTypeError: Type is not msgpack serializable: Secret\n\u003e\u003e\u003e ormsgpack.packb(Secret(\"zxc\"), option=ormsgpack.OPT_PASSTHROUGH_SUBCLASS, default=default)\nb'\\xa6******'\n```\n\n##### `OPT_PASSTHROUGH_TUPLE`\n\nEnable passthrough of `tuple` instances to `default`.\n\n```python\n\u003e\u003e\u003e import ormsgpack\n\u003e\u003e\u003e ormsgpack.packb(\n...     (9193, \"test\", 42),\n... )\nb'\\x93\\xcd#\\xe9\\xa4test*'\n\u003e\u003e\u003e ormsgpack.unpackb(_)\n[9193, 'test', 42]\n\u003e\u003e\u003e 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\u003e\u003e\u003e ormsgpack.unpackb(_)\n{'type': 'tuple', 'value': [9193, 'test', 42]}\n```\n\n##### `OPT_PASSTHROUGH_UUID`\n\nEnable passthrough of `uuid.UUID` instances to `default`.\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\u003e\u003e\u003e import ormsgpack\n\u003e\u003e\u003e ormsgpack.packb({\"b\": 1, \"c\": 2, \"a\": 3})\nb'\\x83\\xa1b\\x01\\xa1c\\x02\\xa1a\\x03'\n\u003e\u003e\u003e 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\u003e\u003e\u003e import ormsgpack\n\u003e\u003e\u003e ormsgpack.packb({\"a\": 1, \"ä\": 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\u003e\u003e\u003e import ormsgpack, datetime\n\u003e\u003e\u003e 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\u003e\u003e\u003e 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) -\u003e 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\u003e\u003e\u003e import ormsgpack, decimal\n\u003e\u003e\u003e def ext_hook(tag, data):\n...     if tag == 0:\n...         return decimal.Decimal(data.decode())\n...     raise TypeError\n...\n\u003e\u003e\u003e ormsgpack.packb(\n...     ormsgpack.Ext(0, str(decimal.Decimal(\"0.0842389659712649442845\")).encode())\n... )\nb'\\xc7\\x18\\x000.0842389659712649442845'\n\u003e\u003e\u003e 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\u003e\u003e\u003e import dataclasses, ormsgpack, typing\n\u003e\u003e\u003e @dataclasses.dataclass\n... class Member:\n...     id: int\n...     active: bool = dataclasses.field(default=False)\n...\n\u003e\u003e\u003e @dataclasses.dataclass\n... class Object:\n...     id: int\n...     name: str\n...     members: typing.List[Member]\n...\n\u003e\u003e\u003e 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\u003e\u003e\u003e import ormsgpack, datetime, zoneinfo\n\u003e\u003e\u003e 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\u003e\u003e\u003e ormsgpack.unpackb(_)\n'2018-12-01T02:03:04.000009+10:30'\n\u003e\u003e\u003e ormsgpack.packb(\n...     datetime.datetime.fromtimestamp(4123518902).replace(tzinfo=datetime.timezone.utc)\n... )\nb'\\xb92100-09-02T00:55:02+00:00'\n\u003e\u003e\u003e ormsgpack.unpackb(_)\n'2100-09-02T00:55:02+00:00'\n\u003e\u003e\u003e ormsgpack.packb(\n...     datetime.datetime.fromtimestamp(4123518902)\n... )\nb'\\xb32100-09-02T00:55:02'\n\u003e\u003e\u003e 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\u003e\u003e\u003e import ormsgpack, datetime\n\u003e\u003e\u003e ormsgpack.packb(datetime.time(12, 0, 15, 290))\nb'\\xaf12:00:15.000290'\n\u003e\u003e\u003e ormsgpack.unpackb(_)\n'12:00:15.000290'\n```\n\n`datetime.date` objects will always serialize.\n\n```python\n\u003e\u003e\u003e import ormsgpack, datetime\n\u003e\u003e\u003e ormsgpack.packb(datetime.date(1900, 1, 2))\nb'\\xaa1900-01-02'\n\u003e\u003e\u003e ormsgpack.unpackb(_)\n'1900-01-02'\n```\n\nErrors with `tzinfo` result in `MsgpackEncodeError` being raised.\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\u003e\u003e\u003e import enum, datetime, ormsgpack\n\u003e\u003e\u003e class DatetimeEnum(enum.Enum):\n...     EPOCH = datetime.datetime(1970, 1, 1, 0, 0, 0)\n...\n\u003e\u003e\u003e ormsgpack.packb(DatetimeEnum.EPOCH)\nb'\\xb31970-01-01T00:00:00'\n\u003e\u003e\u003e ormsgpack.unpackb(_)\n'1970-01-01T00:00:00'\n\u003e\u003e\u003e ormsgpack.packb(DatetimeEnum.EPOCH, option=ormsgpack.OPT_NAIVE_UTC)\nb'\\xb91970-01-01T00:00:00+00:00'\n\u003e\u003e\u003e 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\u003e\u003e\u003e import enum, ormsgpack\n\u003e\u003e\u003e class Custom:\n...     def __init__(self, val):\n...         self.val = val\n...\n\u003e\u003e\u003e def default(obj):\n...     if isinstance(obj, Custom):\n...         return obj.val\n...     raise TypeError\n...\n\u003e\u003e\u003e class CustomEnum(enum.Enum):\n...     ONE = Custom(1)\n...\n\u003e\u003e\u003e ormsgpack.packb(CustomEnum.ONE, default=default)\nb'\\x01'\n\u003e\u003e\u003e 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\u003e\u003e\u003e import ormsgpack, numpy\n\u003e\u003e\u003e 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\u003e\u003e\u003e 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\u003e\u003e\u003e import ormsgpack, uuid\n\u003e\u003e\u003e ormsgpack.packb(uuid.UUID('f81d4fae-7dec-11d0-a765-00a0c91e6bf6'))\nb'\\xd9$f81d4fae-7dec-11d0-a765-00a0c91e6bf6'\n\u003e\u003e\u003e ormsgpack.unpackb(_)\n'f81d4fae-7dec-11d0-a765-00a0c91e6bf6'\n\u003e\u003e\u003e ormsgpack.packb(uuid.uuid5(uuid.NAMESPACE_DNS, \"python.org\"))\nb'\\xd9$886313e1-3b8a-5372-9b90-0c9aee199e5d'\n\u003e\u003e\u003e 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.81\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 \u003c\u003cijl@mailbox.org\u003e\u003e, 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","funding_links":[],"categories":["Rust","Data Processing"],"sub_categories":[],"project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Faviramha%2Formsgpack","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Faviramha%2Formsgpack","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Faviramha%2Formsgpack/lists"}