Skip to main content

Stencil Python client package provides a store to lookup protobuf descriptors and options to keep the protobuf descriptors upto date.

Project description

Stencil Python client

Stencil Python client package provides a store to lookup protobuf descriptors and options to keep the protobuf descriptors upto date.

It has following features

  • Deserialize protobuf messages directly by specifying protobuf message name
  • Ability to refresh protobuf descriptors in specified intervals
  • Support to download descriptors from multiple urls

Requirements

  • Python 3.7+

Installation

Use pip

pip3 install stencil-python-client

Then import the stencil package into your own code as mentioned below

from odpf import stencil

Usage

Creating a client

from odpf import stencil

url = "http://url/to/proto/descriptorset/file"
client = stencil.Client(url)

Creating a multiURLClient

from odpf import stencil

urls = ["http://urlA", "http://urlB"]
client = stencil.MultiUrlClient(urls)

Get Descriptor

from odpf import stencil

url = "http://url/to/proto/descriptorset/file"
client = stencil.Client(url)
client.get_descriptor("google.protobuf.DescriptorProto")

Parse protobuf message.

from odpf import stencil

url = "http://url/to/proto/descriptorset/file"
client = stencil.Client(url)

data = ""
desc = client.parse("google.protobuf.DescriptorProto", data)

Refer to stencil documentation for more information what you can do in stencil.

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

stencil-python-client-0.0.1.tar.gz (6.9 kB view hashes)

Uploaded Source

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