{ "info": { "author": "numproto Contributors", "author_email": "services@xain.io", "bugtrack_url": null, "classifiers": [ "Development Status :: 3 - Alpha", "Intended Audience :: Developers", "License :: OSI Approved :: Apache Software License", "Operating System :: MacOS :: MacOS X", "Operating System :: POSIX :: Linux", "Programming Language :: Python :: 3.6", "Programming Language :: Python :: 3.7", "Programming Language :: Python :: 3 :: Only", "Topic :: Scientific/Engineering", "Topic :: Software Development" ], "description": "# NumProto\n\n**NumProto** is a simple python3.6+ library to serialize and deserialize numpy\narrays into and from protobuf messages.\n\n## Installation\n\nYou can install NumProto from the PyPI package:\n\n```bash\n$ pip install numproto\n```\n\n## Usage\n\nNumProto serializes a numpy array into an `NDArray` message as specified in\n[ndarray.proto](https://github.com/xainag/numproto/blob/master/numproto/protobuf/ndarray.proto):\n\n```proto\nsyntax = \"proto3\";\n\npackage numproto.protobuf;\n\nmessage NDArray {\n bytes ndarray = 1;\n}\n```\n\nThis library provides two methods: one for serialization `ndarray_to_proto` and\none for deserialization `proto_to_ndarray`.\n\n```python\nimport numpy as np\n\nfrom numproto import ndarray_to_proto, proto_to_ndarray\n\nnda = np.arange(10)\n\nserialized_nda = ndarray_to_proto(nda)\ndeserialized_nda = proto_to_ndarray(serialized_nda)\n\nassert np.array_equal(nda, deserialized_nda)\n```\n\n### Re-using the proto files in another project\n\nRe-distributing `*.proto` files is notoriously difficult. In order to make this\neasier the\n[ndarray.proto](https://github.com/xainag/numproto/blob/master/numproto/protobuf/ndarray.proto)\nfile is installed together with the python package.\n\nThis allows us to simply pass the `site-packages` path as an import path to\n`protoc`.\n\n> To get the correct path of `site-packages` check the _Location_ key when\n> running `pip show numproto`.\n\nFor example let's say we want to create a new `proto` file and import `NDArray`\nto use within one of our defined messages:\n\n```proto\nsyntax = \"proto3\";\n\nimport \"numproto/protobuf/ndarray.proto\";\n\nmessage MyMessage {\n numproto.protobuf.NDArray my_array = 1;\n}\n```\n\nAnd to compile using `grpcio-tools` simply do:\n```bash\n$ python -m grpc_tools.protoc -I/usr/lib/python3.6/site-packages/ -I./ --python_out=. --grpc_python_out=. my_proto.proto\n```\n(you may need to adjust the location of `site-packages`)\n\n## Tests\n\nTo run the tests first install the `numproto` package from source in development\nmode and then run the tests using `pytest`:\n\n```bash\n$ git clone https://github.com/xainag/numproto.git\n$ cd numproto\n$ pip install -e .[dev]\n\n$ pytest\n```\n\n\n", "description_content_type": "text/markdown", "docs_url": null, "download_url": "", "downloads": { "last_day": -1, "last_month": -1, "last_week": -1 }, "home_page": "https://github.com/xainag/numproto", "keywords": "", "license": "Apache License Version 2.0", "maintainer": "", "maintainer_email": "", "name": "numproto", "package_url": "https://pypi.org/project/numproto/", "platform": "", "project_url": "https://pypi.org/project/numproto/", "project_urls": { "Homepage": "https://github.com/xainag/numproto" }, "release_url": "https://pypi.org/project/numproto/0.2.0/", "requires_dist": [ "numpy (==1.15.4)", "grpcio (==1.23.0)", "protobuf (==3.9.1)", "grpcio-tools (==1.23.0) ; extra == 'dev'", "black (==19.3b0) ; extra == 'dev'", "pytest (==5.1.2) ; extra == 'dev'", "pytest (==5.1.2) ; extra == 'test'" ], "requires_python": ">=3.6", "summary": "numproto provides numpy arrays to protobuf conversion", "version": "0.2.0" }, "last_serial": 5804220, "releases": { "0.1.0": [ { "comment_text": "", "digests": { "md5": "e9dedd1268ca9dd5f34c0b46f50f406f", "sha256": "ac738e4902ab362b15c6a97060eb83920849289b69009af4c5603a87f4034a52" }, "downloads": -1, "filename": "numproto-0.1.0-py3-none-any.whl", "has_sig": false, "md5_digest": "e9dedd1268ca9dd5f34c0b46f50f406f", "packagetype": "bdist_wheel", "python_version": "py3", "requires_python": ">=3.6", "size": 8117, "upload_time": "2019-09-04T12:44:45", "url": "https://files.pythonhosted.org/packages/1e/64/e2b0defe454e0185ac23406702447f521aa14de25bfe91da9a57ad6db4f2/numproto-0.1.0-py3-none-any.whl" }, { "comment_text": "", "digests": { "md5": "cd251ba016a7cbc355e99b16d6457e0f", "sha256": "bad32754c3ee6c2a29fc2027b7c4acb15beca69cd994afca94ed1f0294a6bfa7" }, "downloads": -1, "filename": "numproto-0.1.0.tar.gz", "has_sig": false, "md5_digest": "cd251ba016a7cbc355e99b16d6457e0f", "packagetype": "sdist", "python_version": "source", "requires_python": ">=3.6", "size": 3637, "upload_time": "2019-09-04T12:44:48", "url": "https://files.pythonhosted.org/packages/d7/9e/cc16e173369a28c02f0cd3e5fc88ca180837c6bc212a105cb76d790a182b/numproto-0.1.0.tar.gz" } ], "0.1.1": [ { "comment_text": "", "digests": { "md5": "2c17a619834437178805b44d324c6aee", "sha256": "edd2833c14d9c852abb43980561d340f4cb2ef885ab33511c62a211fa18bc8df" }, "downloads": -1, "filename": "numproto-0.1.1-py3-none-any.whl", "has_sig": false, "md5_digest": "2c17a619834437178805b44d324c6aee", "packagetype": "bdist_wheel", "python_version": "py3", "requires_python": ">=3.6", "size": 8128, "upload_time": "2019-09-04T13:00:26", "url": "https://files.pythonhosted.org/packages/88/97/e3a991ffdff54e27c23740d2520120dafed1713468ac9a56ef1a7e7ca4a8/numproto-0.1.1-py3-none-any.whl" }, { "comment_text": "", "digests": { "md5": "49c88fce34ef3f1b597cd92b8e77b173", "sha256": "ab1a836d2cbcf33c159c47806c0b09276f8a4bdcd26e38f3011c3ba6e8fde74b" }, "downloads": -1, "filename": "numproto-0.1.1.tar.gz", "has_sig": false, "md5_digest": "49c88fce34ef3f1b597cd92b8e77b173", "packagetype": "sdist", "python_version": "source", "requires_python": ">=3.6", "size": 3647, "upload_time": "2019-09-04T13:00:27", "url": "https://files.pythonhosted.org/packages/7d/11/ebd6800e727faa35a7b1d429cf949aae532d0984a392442246fadb056d09/numproto-0.1.1.tar.gz" } ], "0.2.0": [ { "comment_text": "", "digests": { "md5": "1dee9c931a4fe3f389646e549809ef82", "sha256": "b517faa19470e60919aba50e163a0888ea239451b96b0ee1b4cf8309fd18cdb2" }, "downloads": -1, "filename": "numproto-0.2.0-py3-none-any.whl", "has_sig": false, "md5_digest": "1dee9c931a4fe3f389646e549809ef82", "packagetype": "bdist_wheel", "python_version": "py3", "requires_python": ">=3.6", "size": 9022, "upload_time": "2019-09-09T15:36:41", "url": "https://files.pythonhosted.org/packages/3d/2b/c18684002653da1fdc91a2d48c8ab6e6b742db7b6b9816005f04f5191e76/numproto-0.2.0-py3-none-any.whl" }, { "comment_text": "", "digests": { "md5": "b90aa98a3817ddd7905f40dce63d65d8", "sha256": "bd1fe6772625bbc623f165baa78ebbb3e4aad5f3be0b11999c987b282ecb92f7" }, "downloads": -1, "filename": "numproto-0.2.0.tar.gz", "has_sig": false, "md5_digest": "b90aa98a3817ddd7905f40dce63d65d8", "packagetype": "sdist", "python_version": "source", "requires_python": ">=3.6", "size": 4292, "upload_time": "2019-09-09T15:36:43", "url": "https://files.pythonhosted.org/packages/31/e3/404c0aadbd37e8eebd0afadf58969b9360a2df3a3e94f613cde111d157fd/numproto-0.2.0.tar.gz" } ] }, "urls": [ { "comment_text": "", "digests": { "md5": "1dee9c931a4fe3f389646e549809ef82", "sha256": "b517faa19470e60919aba50e163a0888ea239451b96b0ee1b4cf8309fd18cdb2" }, "downloads": -1, "filename": "numproto-0.2.0-py3-none-any.whl", "has_sig": false, "md5_digest": "1dee9c931a4fe3f389646e549809ef82", "packagetype": "bdist_wheel", "python_version": "py3", "requires_python": ">=3.6", "size": 9022, "upload_time": "2019-09-09T15:36:41", "url": "https://files.pythonhosted.org/packages/3d/2b/c18684002653da1fdc91a2d48c8ab6e6b742db7b6b9816005f04f5191e76/numproto-0.2.0-py3-none-any.whl" }, { "comment_text": "", "digests": { "md5": "b90aa98a3817ddd7905f40dce63d65d8", "sha256": "bd1fe6772625bbc623f165baa78ebbb3e4aad5f3be0b11999c987b282ecb92f7" }, "downloads": -1, "filename": "numproto-0.2.0.tar.gz", "has_sig": false, "md5_digest": "b90aa98a3817ddd7905f40dce63d65d8", "packagetype": "sdist", "python_version": "source", "requires_python": ">=3.6", "size": 4292, "upload_time": "2019-09-09T15:36:43", "url": "https://files.pythonhosted.org/packages/31/e3/404c0aadbd37e8eebd0afadf58969b9360a2df3a3e94f613cde111d157fd/numproto-0.2.0.tar.gz" } ] }