Skip to main content
This is a pre-production deployment of Warehouse. Changes made here affect the production instance of PyPI (
Help us improve Python packaging - Donate today!

Thriftpy instruments for passing metadata

Project Description

Thriftpy instruments for passing metadata bidirectional.


# Server
class Ctx(object):
ctx = Ctx()
ctx.response_meta = {'server': 'test'}

class Handler(object):
    def say_hello(name):
        assert ctx.meta == {'hello': 'test', 'client_name': 'test_client'}
        return Response('Hello ' + name, meta={'api': 'say_hello'})

processor = Processor(ctx, service, Handler())

# Client
client = Client(service, proto, meta={'client_name': 'test_client'})
res ='say_hello', 'world', meta={'hello': 'test'})
assert res.meta == {'api': 'say_hello', 'server': 'test'}
assert res.value == 'Hello world'

Data frame change

Request data frame:

before: message_begin args message_end
after:  meta_begin meta meta_end message_begin args message_end

Response data frame:

before: message_begin result message_end
after:  meta_begin meta meta_end message_begin result message_end

Release History

This version
History Node


History Node


History Node


History Node


History Node


Download Files

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

File Name & Hash SHA256 Hash Help Version File Type Upload Date
(8.3 kB) Copy SHA256 Hash SHA256
py2.py3 Wheel Apr 17, 2017
(5.0 kB) Copy SHA256 Hash SHA256
Source Apr 17, 2017

Supported By

WebFaction WebFaction Technical Writing Elastic Elastic Search Pingdom Pingdom Monitoring Dyn Dyn DNS Sentry Sentry Error Logging CloudAMQP CloudAMQP RabbitMQ Heroku Heroku PaaS Kabu Creative Kabu Creative UX & Design Fastly Fastly CDN DigiCert DigiCert EV Certificate Rackspace Rackspace Cloud Servers DreamHost DreamHost Log Hosting