{ "info": { "author": "Andrey Cizov", "author_email": "acizov@gmail.com", "bugtrack_url": null, "classifiers": [ "Development Status :: 2 - Pre-Alpha", "Intended Audience :: Developers", "License :: OSI Approved :: Apache Software License", "Natural Language :: English", "Programming Language :: Python :: 3.6" ], "description": "============\nprotobuf-gen\n============\n\n.. image:: https://img.shields.io/pypi/v/protobuf-gen.svg\n :target: https://pypi.python.org/pypi/protobuf-gen\n\n.. image:: https://img.shields.io/travis/andreycizov/python-protobuf-gen.svg\n :target: https://travis-ci.org/andreycizov/python-protobuf-gen\n\n.. image:: https://readthedocs.org/projects/protobuf-gen/badge/?version=latest\n :target: https://protobuf-gen.readthedocs.io/en/latest/?badge=latest\n :alt: Documentation Status\n\n.. image:: https://pyup.io/repos/github/andreycizov/python-protobuf-gen/shield.svg\n :target: https://pyup.io/repos/github/andreycizov/python-protobuf-gen/\n :alt: Updates\n\n.. image:: https://codecov.io/gh/andreycizov/python-protobuf-gen/coverage.svg?branch=master\n :target: https://codecov.io/gh/andreycizov/python-protobuf-gen/?branch=master\n\nMotivation\n----------\n\nThis is a library to generate type-hinted protocol buffer bindings. This tool solves two main issues with the original\nGoogle cproto compiler python output:\n\n- cproto does not support exporting the code with the package roots that are different from what had been supplied\n by the original .proto file authors, therefore expecting the protocol users to sed through the code (see issues\n `881 `_ and `1491 `_).\n- It builds the interfaces at run time, therefore disallowing one from using the static type checkers and disabling\n the auto-complete in your favourite IDE.\n\nExample\n_______\n\nThis example is usable for building a fully-functional etcd3 client in python. Otherwise see `tests <./tests>`_.\n\nLet's start by cloning the repositories containing the necessary .proto files to be compiled. Etcd3 references files\nfrom several protobuf libraries, so we are going to need all of them.\n\n.. code-block:: sh\n\n mkdir pb-includes\n\n # etcd references it's own .proto files against the root of their own repository, so the doubling here is intended\n git clone https://github.com/coreos/etcd.git ./pb-includes/etcd/etcd\n\n git clone https://github.com/grpc-ecosystem/grpc-gateway.git ./pb-includes/grpc-gateway\n git clone https://github.com/gogo/protobuf.git ./pb-includes/protobuf\n\n\nNow, let's actually generate the files.\n\n\n.. code-block:: python\n\n from protobuf_gen import remap, wrap\n\n # all of the _pb2 modules will now be importable through `etcd3py.pb_mods.*`\n # for example a module \"google/api/http.proto\" will be available as \"etcd3py.pb_mods.google.api.http_pb2\"\n remap(\n # the working directory is given as the parent directory of the package folder (etcd3py in this case).\n '.',\n 'etcd3py.pb_mods,\n # .proto include directories\n [\n './pb-includes/grpc-gateway/third_party/googleapis',\n './pb-includes/etcd',\n './pb-includes/protobuf',\n ],\n # .proto files to be included in the distribution\n [\n 'etcd/etcdserver/etcdserverpb/rpc.proto',\n 'etcd/mvcc/mvccpb/kv.proto',\n 'etcd/auth/authpb/auth.proto',\n\n 'google/api/annotations.proto',\n 'gogoproto/gogo.proto',\n 'google/api/http.proto',\n ]\n )\n\n\nAuthor\n------\nAndrey Cizov (acizov@gmail.com), 2018", "description_content_type": null, "docs_url": null, "download_url": "", "downloads": { "last_day": -1, "last_month": -1, "last_week": -1 }, "home_page": "https://github.com/andreycizov/python-protobuf-gen", "keywords": "", "license": "", "maintainer": "", "maintainer_email": "", "name": "protobuf-gen", "package_url": "https://pypi.org/project/protobuf-gen/", "platform": "", "project_url": "https://pypi.org/project/protobuf-gen/", "project_urls": { "Homepage": "https://github.com/andreycizov/python-protobuf-gen" }, "release_url": "https://pypi.org/project/protobuf-gen/0.0.4/", "requires_dist": null, "requires_python": "", "summary": "Python 3 type hinted protobuf binding generator", "version": "0.0.4" }, "last_serial": 3646010, "releases": { "0.0.1": [ { "comment_text": "", "digests": { "md5": "c596547e320428fb186f88fa4c24e6a8", "sha256": "85e2f04c3fde016fc98aca1c4035ddc607170e6924cf90b643a207cf92ad3c1a" }, "downloads": -1, "filename": "protobuf_gen-0.0.1.tar.gz", "has_sig": false, "md5_digest": "c596547e320428fb186f88fa4c24e6a8", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 9416, "upload_time": "2018-03-03T01:38:44", "url": "https://files.pythonhosted.org/packages/64/84/fb5ea135a2ceaafab521c7eaff65d2b4283ff5398db4cd37e7e1bc425d89/protobuf_gen-0.0.1.tar.gz" } ], "0.0.2": [ { "comment_text": "", "digests": { "md5": "5a02d7202837d677c7fb86e4cb636fad", "sha256": "8572bcb50008760f090e7a2f5f1c0e433e177bd287270c444f0bffdab327c800" }, "downloads": -1, "filename": "protobuf_gen-0.0.2.tar.gz", "has_sig": false, "md5_digest": "5a02d7202837d677c7fb86e4cb636fad", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 13545, "upload_time": "2018-03-03T02:51:03", "url": "https://files.pythonhosted.org/packages/fc/cb/e672bd7750eb65bc7c117ab963e23f00cfa1fb3adcdcc7cf9a2240ccb957/protobuf_gen-0.0.2.tar.gz" } ], "0.0.4": [ { "comment_text": "", "digests": { "md5": "481fdde6ab4609af4c8fe5193de6d2dd", "sha256": "b262634b883f146c9cf50bf6e3f9684eb7fc705817e4c3a3a7efb31b271f177a" }, "downloads": -1, "filename": "protobuf_gen-0.0.4.tar.gz", "has_sig": false, "md5_digest": "481fdde6ab4609af4c8fe5193de6d2dd", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 13636, "upload_time": "2018-03-07T00:07:59", "url": "https://files.pythonhosted.org/packages/17/fc/06b0db2cd469663d4006466c740788d4a6b33bead9138463af543ef34cad/protobuf_gen-0.0.4.tar.gz" } ] }, "urls": [ { "comment_text": "", "digests": { "md5": "481fdde6ab4609af4c8fe5193de6d2dd", "sha256": "b262634b883f146c9cf50bf6e3f9684eb7fc705817e4c3a3a7efb31b271f177a" }, "downloads": -1, "filename": "protobuf_gen-0.0.4.tar.gz", "has_sig": false, "md5_digest": "481fdde6ab4609af4c8fe5193de6d2dd", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 13636, "upload_time": "2018-03-07T00:07:59", "url": "https://files.pythonhosted.org/packages/17/fc/06b0db2cd469663d4006466c740788d4a6b33bead9138463af543ef34cad/protobuf_gen-0.0.4.tar.gz" } ] }