jsonthrift is implemented for serializing and deserializing json to/from thrift.
Usage
>>> transport = 'TBufferedTransport' >>> protocol = 'TBinaryProtocol' >>> thrift_file = 'tutorial.thrift' >>> service = 'Calculator' >>> method = 'add' >>> params = {'num1': 1, 'num2': 3}>>> jt = JsonThrift(transport, protocol, thrift_file, service) >>> msg = jt.pack_request(method, params, 1) >>> response = send_and_recv(msg) # send msg to server, receive response >>> result = jt.unpack_response(response)[4] >>> print result {'success': 4}>>> method = 'calculate' >>> params = {'logid': 1, 'w':{'op': 4, 'num1': 1, 'num2': 0}} >>> msg = jt.pack_request(method, params, 2) >>> response = send_and_recv(msg) # send msg to server, receive response >>> result = jt.unpack_response(response)[4] >>> print result {'ouch': {'whatOp': 4, 'why': 'Cannot divide by 0'}}>>> # unpack_response returns a tuple, which contains: >>> # message size(TFramedTransport)/None(TBufferedTransport), >>> # message type, will be 2 for thrift REPLY message >>> # method >>> # sequence id >>> # return value
Metadata
Release files for jsonthrift 0.1.4
For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.
Source distribution (sdist)
| File | Size | Uploaded | Provenance | Actions |
|---|---|---|---|---|
| jsonthrift-0.1.4.tar.gz | 5.5 kB | Without provenance | Details for jsonthrift-0.1.4.tar.gz |
Built distribution (wheel)
| File | Interpreter | ABI | Platform | Actions Reset |
|---|---|---|---|---|
| jsonthrift-0.1.4-py2-none-any.whl | Python 2 | none | any | Details for jsonthrift-0.1.4-py2-none-any.whl |
Total release size: 14.4 kB
Release files / jsonthrift-0.1.4.tar.gz
| Download URL | jsonthrift-0.1.4.tar.gz |
|---|---|
| Size | 5.5 kB |
| Tags | Source |
|
SHA-256 checksum How to use checksums |
c3055230fd7547b59fb1ea1398d30177eae19691dd6d3efc0d59049808d2014a
|
|
BLAKE2b-256 checksum How to use checksums |
8714ec1d593051cda167bc23873963890d60b888ce1c458c94c45abb9fb03938
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
Release files / jsonthrift-0.1.4-py2-none-any.whl
| Download URL | jsonthrift-0.1.4-py2-none-any.whl |
|---|---|
| Size | 9.0 kB |
| Tags | Python 2 |
|
SHA-256 checksum How to use checksums |
e9ce499e95a3297cd64e38680099fed7c4bbcf838838d8dc277b9404b1c9b210
|
|
BLAKE2b-256 checksum How to use checksums |
d74578913142b055d84e5f0ee9889d16a0804aa6299eb3bacade2aba1f4e9229
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
Security for jsonthrift 0.1.4
Provenance
Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.
No provenance found
None of the files in this release were uploaded with provenance metadata.
A note on package security
PyPI is a repository for distributing packages, not a service for auditing them. While third-party security researchers and our staff do their best to detect and remove malicious packages, PyPI cannot guarantee the quality, security or suitability of any given package.
To learn more about protecting yourself from malicious actors, visit our package security documentation.