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 details)

Uploaded Source

File details

Details for the file stencil-python-client-0.0.1.tar.gz.

File metadata

  • Download URL: stencil-python-client-0.0.1.tar.gz
  • Upload date:
  • Size: 6.9 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/1.13.0 pkginfo/1.7.1 requests/2.26.0 setuptools/57.0.0 requests-toolbelt/0.9.1 tqdm/4.62.2 CPython/3.9.6

File hashes

Hashes for stencil-python-client-0.0.1.tar.gz
Algorithm Hash digest
SHA256 be8915d79f7f99de09fc531af19388d82aa1d70a0c00290025792543f6693f2a
MD5 0c666e1f43841f90e807f0771d4a8405
BLAKE2b-256 a8c10370ff9fc7edc13846ccebf679b06f260dbe14ebc3cb2049d91ce3280389

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