| Name | polywrap-msgpack JSON |
| Version |
0.1.2
JSON |
| download |
| home_page | |
| Summary | WRAP msgpack encoder/decoder |
| upload_time | 2023-09-06 13:30:21 |
| maintainer | |
| docs_url | None |
| author | Cesar |
| requires_python | >=3.10,<4.0 |
| license | |
| keywords |
|
| VCS |
|
| bugtrack_url |
|
| requirements |
No requirements were recorded.
|
| Travis-CI |
No Travis.
|
| coveralls test coverage |
No coveralls.
|
Polywrap Msgpack
================
polywrap-msgpack adds ability to encode/decode to/from msgpack format.
It provides msgpack_encode and msgpack_decode functions
which allows user to encode and decode to/from msgpack bytes
It also defines the default Extension types and extension hook for
custom extension types defined by WRAP standard
Quickstart
----------
Encoding-Decoding Native types and objects
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
>>> from polywrap_msgpack import msgpack_decode, msgpack_encode
>>> dictionary = {
... "foo": 5,
... "bar": [True, False],
... "baz": {
... "prop": "value"
... }
... }
>>> encoded = msgpack_encode(dictionary)
>>> decoded = msgpack_decode(encoded)
>>> assert dictionary == decoded
>>> print(decoded)
{'foo': 5, 'bar': [True, False], 'baz': {'prop': 'value'}}
Encoding-Decoding Extension types
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
>>> from polywrap_msgpack import msgpack_decode, msgpack_encode, GenericMap
>>> counter: GenericMap[str, int] = GenericMap({
... "a": 3,
... "b": 2,
... "c": 5
... })
>>> encoded = msgpack_encode(counter)
>>> decoded = msgpack_decode(encoded)
>>> assert counter == decoded
>>> print(decoded)
GenericMap({'a': 3, 'b': 2, 'c': 5})
Raw data
{
"_id": null,
"home_page": "",
"name": "polywrap-msgpack",
"maintainer": "",
"docs_url": null,
"requires_python": ">=3.10,<4.0",
"maintainer_email": "",
"keywords": "",
"author": "Cesar",
"author_email": "cesar@polywrap.io",
"download_url": "https://files.pythonhosted.org/packages/b6/12/fb57151fe572525eaaaa0b874cc8c062d8d462447369feeadb7bcd3438ac/polywrap_msgpack-0.1.2.tar.gz",
"platform": null,
"description": "Polywrap Msgpack\n================\n\npolywrap-msgpack adds ability to encode/decode to/from msgpack format.\n\nIt provides msgpack_encode and msgpack_decode functions\nwhich allows user to encode and decode to/from msgpack bytes\n\nIt also defines the default Extension types and extension hook for\ncustom extension types defined by WRAP standard\n\nQuickstart\n----------\n\nEncoding-Decoding Native types and objects\n~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~\n\n>>> from polywrap_msgpack import msgpack_decode, msgpack_encode\n>>> dictionary = {\n... \"foo\": 5,\n... \"bar\": [True, False],\n... \"baz\": {\n... \"prop\": \"value\"\n... }\n... }\n>>> encoded = msgpack_encode(dictionary)\n>>> decoded = msgpack_decode(encoded)\n>>> assert dictionary == decoded\n>>> print(decoded)\n{'foo': 5, 'bar': [True, False], 'baz': {'prop': 'value'}}\n \nEncoding-Decoding Extension types\n~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~\n\n>>> from polywrap_msgpack import msgpack_decode, msgpack_encode, GenericMap\n>>> counter: GenericMap[str, int] = GenericMap({\n... \"a\": 3,\n... \"b\": 2,\n... \"c\": 5\n... })\n>>> encoded = msgpack_encode(counter)\n>>> decoded = msgpack_decode(encoded)\n>>> assert counter == decoded\n>>> print(decoded)\nGenericMap({'a': 3, 'b': 2, 'c': 5})\n",
"bugtrack_url": null,
"license": "",
"summary": "WRAP msgpack encoder/decoder",
"version": "0.1.2",
"project_urls": null,
"split_keywords": [],
"urls": [
{
"comment_text": "",
"digests": {
"blake2b_256": "359816115b38843c8badc88b41c219a1f21cc7f5b3f14d817afa92bf2588d2ee",
"md5": "0217e118b59bff6360b6a8ecd4234b3e",
"sha256": "e5bc6ac3d8b0e69e1256d5b91d6d6986f544383df6da90bba138b25a9864a6e8"
},
"downloads": -1,
"filename": "polywrap_msgpack-0.1.2-py3-none-any.whl",
"has_sig": false,
"md5_digest": "0217e118b59bff6360b6a8ecd4234b3e",
"packagetype": "bdist_wheel",
"python_version": "py3",
"requires_python": ">=3.10,<4.0",
"size": 7302,
"upload_time": "2023-09-06T13:30:20",
"upload_time_iso_8601": "2023-09-06T13:30:20.191953Z",
"url": "https://files.pythonhosted.org/packages/35/98/16115b38843c8badc88b41c219a1f21cc7f5b3f14d817afa92bf2588d2ee/polywrap_msgpack-0.1.2-py3-none-any.whl",
"yanked": false,
"yanked_reason": null
},
{
"comment_text": "",
"digests": {
"blake2b_256": "b612fb57151fe572525eaaaa0b874cc8c062d8d462447369feeadb7bcd3438ac",
"md5": "6ec05d47979797dc408aa14ee226a07d",
"sha256": "36cb8d708d77fda3426118cac9d714f33fd7b52d94873a1f66cb6d6d8b7d13ed"
},
"downloads": -1,
"filename": "polywrap_msgpack-0.1.2.tar.gz",
"has_sig": false,
"md5_digest": "6ec05d47979797dc408aa14ee226a07d",
"packagetype": "sdist",
"python_version": "source",
"requires_python": ">=3.10,<4.0",
"size": 4685,
"upload_time": "2023-09-06T13:30:21",
"upload_time_iso_8601": "2023-09-06T13:30:21.293166Z",
"url": "https://files.pythonhosted.org/packages/b6/12/fb57151fe572525eaaaa0b874cc8c062d8d462447369feeadb7bcd3438ac/polywrap_msgpack-0.1.2.tar.gz",
"yanked": false,
"yanked_reason": null
}
],
"upload_time": "2023-09-06 13:30:21",
"github": false,
"gitlab": false,
"bitbucket": false,
"codeberg": false,
"lcname": "polywrap-msgpack"
}