This is a pre-production deployment of Warehouse. Changes made here affect the production instance of PyPI (pypi.python.org).
Help us improve Python packaging - Donate today!

A JSON-RPC client library, backed by requests

Project Description
jsonrpc-requests: a compact JSON-RPC client library backed by `requests <http://python-requests.org>`_
=======================================================================================================

.. image:: https://travis-ci.org/gciotta/jsonrpc-requests.svg
:target: https://travis-ci.org/gciotta/jsonrpc-requests
.. image:: https://coveralls.io/repos/gciotta/jsonrpc-requests/badge.svg
:target: https://coveralls.io/r/gciotta/jsonrpc-requests

This is a compact and simple JSON-RPC client implementation written while debugging a picky server.

Main Features
-------------

* Python 2.7, 3.4, 3.5, 3.6 compatible
* Exposes requests options
* Supports nested namespaces (eg. `app.users.getUsers()`)
* 100% test coverage

TODO
----

* Batch requests (http://www.jsonrpc.org/specification#batch)

Usage
-----
.. code-block:: python

from jsonrpc_requests import Server
server = Server('http://localhost:8080')
server.foo(1, 2)
server.foo(bar=1, baz=2)
server.foo({'foo': 'bar'})
server.foo.bar(baz=1, qux=2)

A notification:

.. code-block:: python

from jsonrpc_requests import Server
server.foo(bar=1, _notification=True)

Pass through arguments to requests (see also `requests documentation <http://docs.python-requests.org/en/latest/>`_)

.. code-block:: python

from jsonrpc_requests import Server
server = Server('http://localhost:8080', auth=('user', 'pass'), headers={'x-test2': 'true'})

Pass through requests exceptions

.. code-block:: python

from jsonrpc_requests import Server, TransportError
server = Server('http://unknown-host')
try:
server.foo()
except TransportError as transport_error:
print(transport_error.cause) # this will hold a `requests.exceptions.RequestException` instance


Tests
-----
Install the Python tox package and run ``tox``, it'll test this package with various versions of Python.

Credits
-------
`@mbroadst <https://github.com/mbroadst>`_ for providing full support for nested method calls, JSON-RPC RFC
compliance and other improvements.

`@vaab <https://github.com/vaab>`_ for providing api and tests improvements, better RFC compliance.
Release History

Release History

This version
History Node

0.4.0

History Node

0.3.1

History Node

0.3

History Node

0.2

History Node

0.1

Download Files

Download Files

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

File Name & Checksum SHA256 Checksum Help Version File Type Upload Date
jsonrpc-requests-0.4.0.zip (8.9 kB) Copy SHA256 Checksum SHA256 Source Feb 11, 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