{"id":15020431,"url":"https://github.com/lebedov/msgpack-numpy","last_synced_at":"2025-04-08T11:14:39.866Z","repository":{"id":6835643,"uuid":"8084050","full_name":"lebedov/msgpack-numpy","owner":"lebedov","description":"Serialize numpy arrays using msgpack","archived":false,"fork":false,"pushed_at":"2024-07-19T02:45:31.000Z","size":131,"stargazers_count":202,"open_issues_count":4,"forks_count":33,"subscribers_count":9,"default_branch":"master","last_synced_at":"2025-04-01T10:09:12.838Z","etag":null,"topics":["msgpack","numpy","python"],"latest_commit_sha":null,"homepage":"","language":"Python","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"other","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/lebedov.png","metadata":{"files":{"readme":"README.md","changelog":"CHANGES.md","contributing":null,"funding":null,"license":"LICENSE.md","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":"AUTHORS.md","dei":null,"publiccode":null,"codemeta":null}},"created_at":"2013-02-07T23:33:53.000Z","updated_at":"2025-03-22T18:05:08.000Z","dependencies_parsed_at":"2025-01-24T02:10:49.261Z","dependency_job_id":"d75f1aae-c3f6-4767-a147-51878aaf5b82","html_url":"https://github.com/lebedov/msgpack-numpy","commit_stats":{"total_commits":113,"total_committers":10,"mean_commits":11.3,"dds":"0.11504424778761058","last_synced_commit":"fd7032a3045f268f84d26baa7cc9fb7f3cfec99d"},"previous_names":[],"tags_count":29,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/lebedov%2Fmsgpack-numpy","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/lebedov%2Fmsgpack-numpy/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/lebedov%2Fmsgpack-numpy/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/lebedov%2Fmsgpack-numpy/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/lebedov","download_url":"https://codeload.github.com/lebedov/msgpack-numpy/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":247829512,"owners_count":21002997,"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":["msgpack","numpy","python"],"created_at":"2024-09-24T19:55:04.898Z","updated_at":"2025-04-08T11:14:39.837Z","avatar_url":"https://github.com/lebedov.png","language":"Python","funding_links":[],"categories":[],"sub_categories":[],"readme":"\u003c!---\n-*- mode:markdown -*-\nvi:ft=markdown\n--\u003e\nNumpy Data Type Serialization Using Msgpack\n===========================================\n\nPackage Description\n-------------------\nThis package provides encoding and decoding routines that enable the\nserialization and deserialization of numerical and array data types provided by \n[numpy](http://www.numpy.org/) using the highly efficient\n[msgpack](http://msgpack.org/) format. Serialization of Python's\nnative complex data types is also supported.\n\n[![Latest Version](https://img.shields.io/pypi/v/msgpack-numpy.svg)](https://pypi.python.org/pypi/msgpack-numpy)\n[![Build Status](https://travis-ci.org/lebedov/msgpack-numpy.svg?branch=master)](https://travis-ci.org/lebedov/msgpack-numpy)\n\nInstallation\n------------\nmsgpack-numpy requires msgpack-python and numpy. If you \nhave [pip](http://www.pip-installer.org/) installed on your\nsystem, run\n\n    pip install msgpack-numpy\n\nto install the package and all dependencies. You can also download \nthe source tarball, unpack it, and run\n\n    python setup.py install\n\nfrom within the source directory.\n\nUsage\n-----\nThe easiest way to use msgpack-numpy is to call its monkey patching\nfunction after importing the Python msgpack package:\n\n    import msgpack\n    import msgpack_numpy as m\n    m.patch()\n\nThis will automatically force all msgpack serialization and deserialization\nroutines (and other packages that use them) to become numpy-aware. \nOf course, one can also manually pass the encoder and \ndecoder provided by msgpack-numpy to the msgpack routines:\n\n    import msgpack\n    import msgpack_numpy as m\n    import numpy as np\n\n    x = np.random.rand(5)\n    x_enc = msgpack.packb(x, default=m.encode)\n    x_rec = msgpack.unpackb(x_enc, object_hook=m.decode)\n\nmsgpack-numpy will try to use the binary (fast) extension in msgpack by default.  \nIf msgpack was not compiled with Cython (or if the ``MSGPACK_PUREPYTHON`` \nvariable is set), it will fall back to using the slower pure Python msgpack \nimplementation.\n\nNotes\n-----\nThe primary design goal of msgpack-numpy is ensuring preservation of numerical\ndata types during msgpack serialization and deserialization. Inclusion of type\ninformation in the serialized data necessarily incurs some storage overhead; if\npreservation of type information is not needed, one may be able to avoid some\nof this overhead by writing a custom encoder/decoder pair that produces more\nefficient serializations for those specific use cases. \n\nNumpy arrays with a dtype of 'O' are serialized/deserialized using pickle as \na fallback solution to enable msgpack-numpy to handle\nsuch arrays. As the additional overhead of pickle serialization negates one\nof the reasons to use msgpack, it may be advisable to either write a custom\nencoder/decoder to handle the specific use case efficiently or else not bother\nusing msgpack-numpy.\n\nNote that numpy arrays deserialized by msgpack-numpy are read-only and must be copied \nif they are to be modified.\n\nDevelopment\n-----------\nThe latest source code can be obtained from [GitHub](https://github.com/lebedov/msgpack-numpy/).\n\nmsgpack-numpy maintains compatibility with python versions 2.7 and 3.5+.\n\nInstall [`tox`](https://tox.readthedocs.io/en/latest/) to support testing\nacross multiple python versions in your development environment. If you\nuse [`conda`](https://docs.conda.io/en/latest/) to install `python` use\n[`tox-conda`](https://github.com/tox-dev/tox-conda) to automatically manage\ntesting across all supported python versions.\n    \n    # Using a system python\n    pip install tox\n\n    # Additionally, using a conda-provided python\n    pip install tox tox-conda\n\nExecute tests across supported python versions:\n    \n    tox\n\nAuthors\n-------\nSee the included [AUTHORS.md](https://github.com/lebedov/msgpack-numpy/blob/master/AUTHORS.md) file for \nmore information.\n\nLicense\n-------\nThis software is licensed under the [BSD License](http://www.opensource.org/licenses/bsd-license).\nSee the included [LICENSE.md](https://github.com/lebedov/msgpack-numpy/blob/master/LICENSE.md) file for \nmore information.\n\nSee Also\n--------\n[msgpack-numpy-js](https://github.com/emerald-geomodelling/msgpack-numpy-js) by \n[Egil Möller](https://github.com/redhog) is a JavaScript library that can \nserialize and deserialize JS typed arrays with msgpack.\n\n[msgpack-numpy-rs](https://github.com/clearviewai/msgpack-numpy-rs) by [\nTerrence Liu](https://github.com/terencezl) is a Rust crate (mostly) compatible with msgpack-numpy \nthat can serialize and deserialize numpy arrays with msgpack.\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Flebedov%2Fmsgpack-numpy","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Flebedov%2Fmsgpack-numpy","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Flebedov%2Fmsgpack-numpy/lists"}