pyprotostuben


Namepyprotostuben JSON
Version 0.3.2 PyPI version JSON
download
home_pageNone
SummaryGenerate Python MyPy stub modules from protobuf files.
upload_time2024-11-28 22:30:12
maintainerNone
docs_urlNone
authorzerlok
requires_python<4.0,>=3.9
licenseMIT
keywords python codegen protobuf grpc
VCS
bugtrack_url
requirements No requirements were recorded.
Travis-CI No Travis.
coveralls test coverage No coveralls.
            # pyprotostuben

[![Latest Version](https://img.shields.io/pypi/v/pyprotostuben.svg)](https://pypi.python.org/pypi/pyprotostuben)
[![Python Supported Versions](https://img.shields.io/pypi/pyversions/pyprotostuben.svg)](https://pypi.python.org/pypi/pyprotostuben)
[![MyPy Strict](https://img.shields.io/badge/mypy-strict-blue)](https://mypy.readthedocs.io/en/stable/getting_started.html#strict-mode-and-configuration)
[![Test Coverage](https://codecov.io/gh/zerlok/pyprotostuben/branch/main/graph/badge.svg)](https://codecov.io/gh/zerlok/pyprotostuben)
[![Downloads](https://img.shields.io/pypi/dm/pyprotostuben.svg)](https://pypistats.org/packages/pyprotostuben)
[![GitHub stars](https://img.shields.io/github/stars/zerlok/pyprotostuben)](https://github.com/zerlok/pyprotostuben/stargazers)

Generate Python modules from protobuf files.

## usage

[pypi package](https://pypi.python.org/pypi/pyprotostuben)

install with your favorite python package manager

```bash
pip install pyprotostuben
```

Then use protoc plugins to generate python code. See [greeting examples](examples/greeting/README.md) for more info.

## protoc plugins

### protoc-gen-mypy-stub

Generates python stubs (`*_pb2.pyi` & `*_pb2_grpc.pyi` files which then used by MyPy type checker / IDE syntax highlits
& suggestions).

**features:**

* choose message structure immutability / mutability
* choose async / sync grpc module stubs
* grpc servicer abstract methods have full signature (with appropriate type args in generics), thus it is easier to
  implement methods in IDE

**plugin options:**

* `message-mutable` -- add setters for fields, use mutable containers
* `message-all-init-args-optional` -- each field is optional in message constructor (even if field is not optional)
* `grpc-sync` -- use sync grpc stubs instead of grpc.aio module and async defs
* `grpc-skip-servicer` -- don't generate code for servicers
* `grpc-skip-stub` -- don't generate code for stubs
* `no-parallel` -- disable multiprocessing
* `debug` -- turn on plugin debugging

### protoc-gen-brokrpc

Generates `*_brokrpc.py` modules for [BrokRPC](https://github.com/zerlok/BrokRPC) framework. This is similar to gRPC
codegen (`*_pb2_grpc.py` modules).

**plugin options:**

* `no-parallel` -- disable multiprocessing
* `debug` -- turn on plugin debugging

### protoc-gen-echo

Saves protoc plugin input to a file. Helps develop protoc plugins.

**plugin options:**

* `format={raw|binary|json}` (default = `raw`) -- specify output format
* `dest={path}` (default = `request.json`) -- specify file destination


            

Raw data

            {
    "_id": null,
    "home_page": null,
    "name": "pyprotostuben",
    "maintainer": null,
    "docs_url": null,
    "requires_python": "<4.0,>=3.9",
    "maintainer_email": null,
    "keywords": "python, codegen, protobuf, grpc",
    "author": "zerlok",
    "author_email": "danil.troshnev@gmail.com",
    "download_url": "https://files.pythonhosted.org/packages/fd/4b/39f3132b09bfa31604e0bc9ab65ace97b49ce11aef667d56d9a6dbf2aff0/pyprotostuben-0.3.2.tar.gz",
    "platform": null,
    "description": "# pyprotostuben\n\n[![Latest Version](https://img.shields.io/pypi/v/pyprotostuben.svg)](https://pypi.python.org/pypi/pyprotostuben)\n[![Python Supported Versions](https://img.shields.io/pypi/pyversions/pyprotostuben.svg)](https://pypi.python.org/pypi/pyprotostuben)\n[![MyPy Strict](https://img.shields.io/badge/mypy-strict-blue)](https://mypy.readthedocs.io/en/stable/getting_started.html#strict-mode-and-configuration)\n[![Test Coverage](https://codecov.io/gh/zerlok/pyprotostuben/branch/main/graph/badge.svg)](https://codecov.io/gh/zerlok/pyprotostuben)\n[![Downloads](https://img.shields.io/pypi/dm/pyprotostuben.svg)](https://pypistats.org/packages/pyprotostuben)\n[![GitHub stars](https://img.shields.io/github/stars/zerlok/pyprotostuben)](https://github.com/zerlok/pyprotostuben/stargazers)\n\nGenerate Python modules from protobuf files.\n\n## usage\n\n[pypi package](https://pypi.python.org/pypi/pyprotostuben)\n\ninstall with your favorite python package manager\n\n```bash\npip install pyprotostuben\n```\n\nThen use protoc plugins to generate python code. See [greeting examples](examples/greeting/README.md) for more info.\n\n## protoc plugins\n\n### protoc-gen-mypy-stub\n\nGenerates python stubs (`*_pb2.pyi` & `*_pb2_grpc.pyi` files which then used by MyPy type checker / IDE syntax highlits\n& suggestions).\n\n**features:**\n\n* choose message structure immutability / mutability\n* choose async / sync grpc module stubs\n* grpc servicer abstract methods have full signature (with appropriate type args in generics), thus it is easier to\n  implement methods in IDE\n\n**plugin options:**\n\n* `message-mutable` -- add setters for fields, use mutable containers\n* `message-all-init-args-optional` -- each field is optional in message constructor (even if field is not optional)\n* `grpc-sync` -- use sync grpc stubs instead of grpc.aio module and async defs\n* `grpc-skip-servicer` -- don't generate code for servicers\n* `grpc-skip-stub` -- don't generate code for stubs\n* `no-parallel` -- disable multiprocessing\n* `debug` -- turn on plugin debugging\n\n### protoc-gen-brokrpc\n\nGenerates `*_brokrpc.py` modules for [BrokRPC](https://github.com/zerlok/BrokRPC) framework. This is similar to gRPC\ncodegen (`*_pb2_grpc.py` modules).\n\n**plugin options:**\n\n* `no-parallel` -- disable multiprocessing\n* `debug` -- turn on plugin debugging\n\n### protoc-gen-echo\n\nSaves protoc plugin input to a file. Helps develop protoc plugins.\n\n**plugin options:**\n\n* `format={raw|binary|json}` (default = `raw`) -- specify output format\n* `dest={path}` (default = `request.json`) -- specify file destination\n\n",
    "bugtrack_url": null,
    "license": "MIT",
    "summary": "Generate Python MyPy stub modules from protobuf files.",
    "version": "0.3.2",
    "project_urls": {
        "Homepage": "https://github.com/zerlok/pyprotostuben",
        "Issues": "https://github.com/zerlok/pyprotostuben/issues"
    },
    "split_keywords": [
        "python",
        " codegen",
        " protobuf",
        " grpc"
    ],
    "urls": [
        {
            "comment_text": "",
            "digests": {
                "blake2b_256": "6b773a0bc7262df91b9428027d51322b11a5b111e8c72808ff0c461e1239a95e",
                "md5": "4ff66d023e52904962a870c6b92602e0",
                "sha256": "a04f2c5bd00b86d1f3348ccade474aa132eeff15ea73979ea6c2819ee44d9c20"
            },
            "downloads": -1,
            "filename": "pyprotostuben-0.3.2-py3-none-any.whl",
            "has_sig": false,
            "md5_digest": "4ff66d023e52904962a870c6b92602e0",
            "packagetype": "bdist_wheel",
            "python_version": "py3",
            "requires_python": "<4.0,>=3.9",
            "size": 36639,
            "upload_time": "2024-11-28T22:30:11",
            "upload_time_iso_8601": "2024-11-28T22:30:11.529443Z",
            "url": "https://files.pythonhosted.org/packages/6b/77/3a0bc7262df91b9428027d51322b11a5b111e8c72808ff0c461e1239a95e/pyprotostuben-0.3.2-py3-none-any.whl",
            "yanked": false,
            "yanked_reason": null
        },
        {
            "comment_text": "",
            "digests": {
                "blake2b_256": "fd4b39f3132b09bfa31604e0bc9ab65ace97b49ce11aef667d56d9a6dbf2aff0",
                "md5": "aa6a2282399e0574c542c2105de39bf0",
                "sha256": "9e17abdb59e322bb01a88e59d80c4b684030d9c4180cd1d36ac9439992f34822"
            },
            "downloads": -1,
            "filename": "pyprotostuben-0.3.2.tar.gz",
            "has_sig": false,
            "md5_digest": "aa6a2282399e0574c542c2105de39bf0",
            "packagetype": "sdist",
            "python_version": "source",
            "requires_python": "<4.0,>=3.9",
            "size": 27147,
            "upload_time": "2024-11-28T22:30:12",
            "upload_time_iso_8601": "2024-11-28T22:30:12.799865Z",
            "url": "https://files.pythonhosted.org/packages/fd/4b/39f3132b09bfa31604e0bc9ab65ace97b49ce11aef667d56d9a6dbf2aff0/pyprotostuben-0.3.2.tar.gz",
            "yanked": false,
            "yanked_reason": null
        }
    ],
    "upload_time": "2024-11-28 22:30:12",
    "github": true,
    "gitlab": false,
    "bitbucket": false,
    "codeberg": false,
    "github_user": "zerlok",
    "github_project": "pyprotostuben",
    "travis_ci": false,
    "coveralls": false,
    "github_actions": true,
    "lcname": "pyprotostuben"
}
        
Elapsed time: 0.54443s