Name | protoplasm JSON |
Version |
5.3.1
JSON |
| download |
home_page | None |
Summary | Utilities for working with Protobuf & gRPC in Python. |
upload_time | 2024-09-24 16:08:28 |
maintainer | None |
docs_url | None |
author | None |
requires_python | None |
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. |
keywords |
protobuf
proto
dataclasses
tools
ccp
utils
|
VCS |
|
bugtrack_url |
|
requirements |
ccptools
grpcio
grpcio-tools
googleapis-common-protos
protobuf
|
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/d3/98/31b0d2774c7113c0a1008422a28d365efc5be0b6e8c036aff50b86e74672/protoplasm-5.3.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.3.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": "11a3db697e7eb27fc6deac5471ae69e75cd2afa0e245c309e1f33fc904eb610e",
"md5": "c03035fad7a027fdf538d59db9d033b9",
"sha256": "e113e1a42031ee9e995b5a3342359670c8f03748c7feb19bf1e622070f509daa"
},
"downloads": -1,
"filename": "protoplasm-5.3.1-py3-none-any.whl",
"has_sig": false,
"md5_digest": "c03035fad7a027fdf538d59db9d033b9",
"packagetype": "bdist_wheel",
"python_version": "py3",
"requires_python": null,
"size": 35640,
"upload_time": "2024-09-24T16:08:27",
"upload_time_iso_8601": "2024-09-24T16:08:27.468301Z",
"url": "https://files.pythonhosted.org/packages/11/a3/db697e7eb27fc6deac5471ae69e75cd2afa0e245c309e1f33fc904eb610e/protoplasm-5.3.1-py3-none-any.whl",
"yanked": false,
"yanked_reason": null
},
{
"comment_text": "",
"digests": {
"blake2b_256": "d39831b0d2774c7113c0a1008422a28d365efc5be0b6e8c036aff50b86e74672",
"md5": "7fe068050b30a097f5c07b98b83705d6",
"sha256": "e142eafda1a8eca651f6f661d4c5e18be09fb6a559b4da8fab66144a6d49b1f5"
},
"downloads": -1,
"filename": "protoplasm-5.3.1.tar.gz",
"has_sig": false,
"md5_digest": "7fe068050b30a097f5c07b98b83705d6",
"packagetype": "sdist",
"python_version": "source",
"requires_python": null,
"size": 45566,
"upload_time": "2024-09-24T16:08:28",
"upload_time_iso_8601": "2024-09-24T16:08:28.760424Z",
"url": "https://files.pythonhosted.org/packages/d3/98/31b0d2774c7113c0a1008422a28d365efc5be0b6e8c036aff50b86e74672/protoplasm-5.3.1.tar.gz",
"yanked": false,
"yanked_reason": null
}
],
"upload_time": "2024-09-24 16:08:28",
"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": [
[
">=",
"1.1"
],
[
"<",
"2"
]
]
},
{
"name": "grpcio",
"specs": [
[
"<",
"2"
],
[
">=",
"1.66.1"
]
]
},
{
"name": "grpcio-tools",
"specs": [
[
"<",
"2"
],
[
">=",
"1.66.1"
]
]
},
{
"name": "googleapis-common-protos",
"specs": [
[
">=",
"1.65"
],
[
"<",
"2"
]
]
},
{
"name": "protobuf",
"specs": [
[
"==",
"5.27.2"
]
]
}
],
"lcname": "protoplasm"
}