Skip to main content

JSON-RPC 2.0 server library for Python 3.

Project description

https://pypip.in/v/jsonrpcserver/badge.png https://pypip.in/d/jsonrpcserver/badge.png

Receive JSON-RPC requests in a Flask app.

Simply register the blueprint, then dispatch the requests to your own code.

app = Flask(__name__)
app.register_blueprint(bp)

# Add a route to take requests.
@app.route('/', methods=['POST'])
def index():
    return dispatch(HandleRequests)

class HandleRequests:
    def add(x, y):
        return x + y

Installation

$ pip install jsonrpcserver

Documentation

Documentation is available at http://jsonrpcserver.readthedocs.org/.

If you need a client, try my jsonrpcclient library.

Release History

1.0.6 (2014-12-11)

  • Improved blueprint, with correct http status code responses.

  • Gives more information when rejecting a request.

  • Major rebuild of the exceptions.

  • More stability with 100% code coverage in tests.

1.0.5 (2014-12-02)

  • Messages are now output on the INFO log level.

  • Show the status code in response log entries.

1.0.4 (2014-11-22)

  • Fixed readme.

1.0.3 (2014-11-21)

  • The underlying JSON messages are now hidden by default. To see them you should increase the logging level (see above).

  • Tests moved into separate “tests” dir.

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

jsonrpcserver-1.0.6.tar.gz (6.3 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