https://github.com/loggi/proto-schematics
Making Protobuf messages as cute as Python.
https://github.com/loggi/proto-schematics
Last synced: 17 days ago
JSON representation
Making Protobuf messages as cute as Python.
- Host: GitHub
- URL: https://github.com/loggi/proto-schematics
- Owner: loggi
- License: apache-2.0
- Created: 2017-09-01T16:41:50.000Z (over 7 years ago)
- Default Branch: master
- Last Pushed: 2022-09-23T20:53:48.000Z (over 2 years ago)
- Last Synced: 2025-04-07T03:01:43.632Z (about 2 months ago)
- Language: Python
- Homepage:
- Size: 18.6 KB
- Stars: 5
- Watchers: 229
- Forks: 0
- Open Issues: 2
-
Metadata Files:
- Readme: README.rst
- Changelog: CHANGELOG.rst
- License: LICENSE
Awesome Lists containing this project
README
Proto Schematics
================*Making Protobuf messages as cute as Python.*
Motivation
----------Protobuf and gRPC are great when it comes to high performance schema aware APIs,
but when Google designed Protobuf, it didn't tried to make the generated code
idiomatic in Python, which brings a problem when exporting messages outside
interface modules. Schematics is a cute and Pythonic schema library that goes
well with most applications. Why not join both?Installing
----------Using pip::
pip install proto_schamatics
Examples
--------Inspecting a module is as simple as:
.. code:: python
from proto_schematics import ProtobufModule
models = ProtobufModule('my.protobuf.lib').import_schema()
MySchamticsModel = models['ProtobufMessageName']You can also do it on a lazy lint unfriendly way:
.. code:: python
from proto_schematics import ProtobufModule
ProtobufModule('my.protobuf.lib').meta_import()from protobuf_schematics import ProtobufMessageName as MySchematicsModel
Supports
--------* Datetimes as native Python
* Duration as TimeDeltas
* Wrappers as native nullable types