protoplasm


Nameprotoplasm JSON
Version 5.0.1 PyPI version JSON
download
home_pageNone
SummaryUtilities for working with Protobuf & gRPC in Python.
upload_time2024-04-19 08:21:09
maintainerNone
docs_urlNone
authorNone
requires_pythonNone
licenseMIT License Copyright (c) 2019-2024 CCP Games Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions: The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software. THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
keywords protobuf proto dataclasses tools ccp utils
VCS
bugtrack_url
requirements ccptools protobuf grpcio grpcio-tools googleapis-common-protos
Travis-CI No Travis.
coveralls test coverage No coveralls.
            # Protoplasm

Utilities for working with Protobuf & gRPC in Python, e.g; compiling Python 3 
Dataclasses from compiled proto-message-python code and casting between the two,
quickly initializing large/nested Protobuf object, simplifying gRPC service 
interfaces etc. 

## IMPORTANT

Update this README file after moving from CCP's internal code repo to Github.



## Protoplasm 4

* Unify the unary functionality of Protoplasm 2 with the streaming 
  functionality of Protoplasm 3
  * The two turn out to be completely incompatible and API shattering
  * Protoplasm 4 must incorporate BOTH functionalities wile being backwards 
    compatible enough for both Protoplasm 2 and 3 projects to be able to 
    migrate to 4
  * The key here is detecting the `stream` keyword in protos that denote 
    streaming input and/or output
* Add piled up functionality/utility/QoL improvements/bugs that's been on The 
  Listâ„¢ for a while
  * Cast to/from base64 encoded strings
  * Utilize the `__all__` directive to isolate `import *` side effects 
  * Integrate the Neobuf Builder CLI (from various other projects) into 
    Protoplasm and generalize it
  * Address the "`None` is default value" issue
  * Explore the pros/cons of making non-existing Message/Object attributes 
    return `Empty` or `EmptyDict` to simplify nested attribute fetching...?
* Refactor and restructure the package properly
  * Separate the 4 main roles of the package logically
    1. Cross-piling `*.proto` to `*_pb2.py` and `*_pb2_grpc.py`
    2. Cross-piling `*_pb2.py` to `*_dc.py` Neobuf Dataclasses
    3. Generating `*_api.py` interfaces
    4. Generating gRPC implementation of Services

## Troubleshooting

* I get `TypeError: Plain typing.NoReturn is not valid as type argument`
    * Upgrade to Python 3.9. This TypeError arises from [a bug in Python 3.7](https://bugs.python.org/issue34921)


## Clever bits to document...

- Code Generation (e.g. `foo.proto`) + how to build
    - Dataclasses -> `foo_dc.py` + how to use (+ DataclassBase freebies)
        - Extending Dataclasses (a no-no for pb2 files apparently)
    - Service API -> `foo_api.py` + how to use and implement
        - Automatic parameter unpacking
        - Return value packing
        - Raising `protoplasm.errors.api.*` on errors or non-ok returns
        - Using `protoplasm.decorators` for param and type checking
        - The `takes_context` decorator and how to use it
    - GRPC DC Service Servicer -> `foo_dc_grpc.py` + how to use
- Utilities
    - Proto <-> dict <-> Dataclass casters
    - The `mkproto` and `mkdataclass` helpers
    - The `unpack_dataclass_request` and `pack_dataclass_response` helpers

            

Raw data

            {
    "_id": null,
    "home_page": null,
    "name": "protoplasm",
    "maintainer": null,
    "docs_url": null,
    "requires_python": null,
    "maintainer_email": null,
    "keywords": "protobuf, proto, dataclasses, tools, ccp, utils",
    "author": null,
    "author_email": "Thordur Matthiasson <thordurm@ccpgames.com>, Daniel Maxson <dmaxson@ccpgames.com>",
    "download_url": "https://files.pythonhosted.org/packages/24/34/5eda4e0389baa2f93d7e55778a8faf2ae8a107a065ec39df4f016f0b4be2/protoplasm-5.0.1.tar.gz",
    "platform": null,
    "description": "# Protoplasm\n\nUtilities for working with Protobuf & gRPC in Python, e.g; compiling Python 3 \nDataclasses from compiled proto-message-python code and casting between the two,\nquickly initializing large/nested Protobuf object, simplifying gRPC service \ninterfaces etc. \n\n## IMPORTANT\n\nUpdate this README file after moving from CCP's internal code repo to Github.\n\n\n\n## Protoplasm 4\n\n* Unify the unary functionality of Protoplasm 2 with the streaming \n  functionality of Protoplasm 3\n  * The two turn out to be completely incompatible and API shattering\n  * Protoplasm 4 must incorporate BOTH functionalities wile being backwards \n    compatible enough for both Protoplasm 2 and 3 projects to be able to \n    migrate to 4\n  * The key here is detecting the `stream` keyword in protos that denote \n    streaming input and/or output\n* Add piled up functionality/utility/QoL improvements/bugs that's been on The \n  List\u2122 for a while\n  * Cast to/from base64 encoded strings\n  * Utilize the `__all__` directive to isolate `import *` side effects \n  * Integrate the Neobuf Builder CLI (from various other projects) into \n    Protoplasm and generalize it\n  * Address the \"`None` is default value\" issue\n  * Explore the pros/cons of making non-existing Message/Object attributes \n    return `Empty` or `EmptyDict` to simplify nested attribute fetching...?\n* Refactor and restructure the package properly\n  * Separate the 4 main roles of the package logically\n    1. Cross-piling `*.proto` to `*_pb2.py` and `*_pb2_grpc.py`\n    2. Cross-piling `*_pb2.py` to `*_dc.py` Neobuf Dataclasses\n    3. Generating `*_api.py` interfaces\n    4. Generating gRPC implementation of Services\n\n## Troubleshooting\n\n* I get `TypeError: Plain typing.NoReturn is not valid as type argument`\n    * Upgrade to Python 3.9. This TypeError arises from [a bug in Python 3.7](https://bugs.python.org/issue34921)\n\n\n## Clever bits to document...\n\n- Code Generation (e.g. `foo.proto`) + how to build\n    - Dataclasses -> `foo_dc.py` + how to use (+ DataclassBase freebies)\n        - Extending Dataclasses (a no-no for pb2 files apparently)\n    - Service API -> `foo_api.py` + how to use and implement\n        - Automatic parameter unpacking\n        - Return value packing\n        - Raising `protoplasm.errors.api.*` on errors or non-ok returns\n        - Using `protoplasm.decorators` for param and type checking\n        - The `takes_context` decorator and how to use it\n    - GRPC DC Service Servicer -> `foo_dc_grpc.py` + how to use\n- Utilities\n    - Proto <-> dict <-> Dataclass casters\n    - The `mkproto` and `mkdataclass` helpers\n    - The `unpack_dataclass_request` and `pack_dataclass_response` helpers\n",
    "bugtrack_url": null,
    "license": "MIT License  Copyright (c) 2019-2024 CCP Games  Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the \"Software\"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions:  The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software.  THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. ",
    "summary": "Utilities for working with Protobuf & gRPC in Python.",
    "version": "5.0.1",
    "project_urls": {
        "Changelog": "https://github.com/ccpgames/protoplasm/blob/main/CHANGELOG.md",
        "Documentation": "https://github.com/ccpgames/protoplasm/blob/main/README.md",
        "Homepage": "https://github.com/ccpgames/protoplasm",
        "Issues": "https://github.com/ccpgames/protoplasm/issues",
        "Repository": "https://github.com/ccpgames/protoplasm.git"
    },
    "split_keywords": [
        "protobuf",
        " proto",
        " dataclasses",
        " tools",
        " ccp",
        " utils"
    ],
    "urls": [
        {
            "comment_text": "",
            "digests": {
                "blake2b_256": "0dda3016736eaf47c347e85d12b4983d44a332c8ed60847d1bfffe33e3d5dc49",
                "md5": "a29ed98081b4bd8cd0739845c644a6c5",
                "sha256": "66866b162706c36167e5da23a66df1a82181b54997765c28aa289157f882d9fc"
            },
            "downloads": -1,
            "filename": "protoplasm-5.0.1-py3-none-any.whl",
            "has_sig": false,
            "md5_digest": "a29ed98081b4bd8cd0739845c644a6c5",
            "packagetype": "bdist_wheel",
            "python_version": "py3",
            "requires_python": null,
            "size": 35606,
            "upload_time": "2024-04-19T08:21:08",
            "upload_time_iso_8601": "2024-04-19T08:21:08.489917Z",
            "url": "https://files.pythonhosted.org/packages/0d/da/3016736eaf47c347e85d12b4983d44a332c8ed60847d1bfffe33e3d5dc49/protoplasm-5.0.1-py3-none-any.whl",
            "yanked": false,
            "yanked_reason": null
        },
        {
            "comment_text": "",
            "digests": {
                "blake2b_256": "24345eda4e0389baa2f93d7e55778a8faf2ae8a107a065ec39df4f016f0b4be2",
                "md5": "3581ad4dae5fa6e061545d1e847d64dd",
                "sha256": "3ca181eb6a3f8eac76854c275500aa2f843f92a6faa86120957b5425b0e6250b"
            },
            "downloads": -1,
            "filename": "protoplasm-5.0.1.tar.gz",
            "has_sig": false,
            "md5_digest": "3581ad4dae5fa6e061545d1e847d64dd",
            "packagetype": "sdist",
            "python_version": "source",
            "requires_python": null,
            "size": 43708,
            "upload_time": "2024-04-19T08:21:09",
            "upload_time_iso_8601": "2024-04-19T08:21:09.645180Z",
            "url": "https://files.pythonhosted.org/packages/24/34/5eda4e0389baa2f93d7e55778a8faf2ae8a107a065ec39df4f016f0b4be2/protoplasm-5.0.1.tar.gz",
            "yanked": false,
            "yanked_reason": null
        }
    ],
    "upload_time": "2024-04-19 08:21:09",
    "github": true,
    "gitlab": false,
    "bitbucket": false,
    "codeberg": false,
    "github_user": "ccpgames",
    "github_project": "protoplasm",
    "travis_ci": false,
    "coveralls": false,
    "github_actions": true,
    "requirements": [
        {
            "name": "ccptools",
            "specs": [
                [
                    "<",
                    "2"
                ],
                [
                    ">=",
                    "1.1"
                ]
            ]
        },
        {
            "name": "protobuf",
            "specs": [
                [
                    ">=",
                    "4.25.3"
                ],
                [
                    "<",
                    "5"
                ]
            ]
        },
        {
            "name": "grpcio",
            "specs": [
                [
                    "<",
                    "2"
                ],
                [
                    ">=",
                    "1.62.1"
                ]
            ]
        },
        {
            "name": "grpcio-tools",
            "specs": [
                [
                    "<",
                    "2"
                ],
                [
                    ">=",
                    "1.62.1"
                ]
            ]
        },
        {
            "name": "googleapis-common-protos",
            "specs": [
                [
                    "<",
                    "2"
                ],
                [
                    ">=",
                    "1.63.0"
                ]
            ]
        }
    ],
    "lcname": "protoplasm"
}
        
Elapsed time: 0.35330s