Skip to main content

Converts protobuf generated messages to Python friendly schematics models.

Project description

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 iterface modules.

Schematics is a cute and pythonic schema library. Why not join both?

Installing

Using pip:

pip install proto_schamatics

Examples

Inspecting a module is as simple as:

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:

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

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

proto_schematics-0.1.0.tar.gz (4.1 kB view details)

Uploaded Source

File details

Details for the file proto_schematics-0.1.0.tar.gz.

File metadata

File hashes

Hashes for proto_schematics-0.1.0.tar.gz
Algorithm Hash digest
SHA256 5c8c7aaabc5a941584676ecef3fb78077fe321eb57ff60b0a8b4490998e90b2f
MD5 ae53ae70d5120e1369cf0304be896f4c
BLAKE2b-256 af57a277e8f15202eb33d744a764a3cc6da0b55c0e0bfc2adedb474f516e612c

See more details on using hashes here.

Supported by

AWS AWS Cloud computing and Security Sponsor Datadog Datadog Monitoring Fastly Fastly CDN Google Google Download Analytics Microsoft Microsoft PSF Sponsor Pingdom Pingdom Monitoring Sentry Sentry Error logging StatusPage StatusPage Status page