Skip to main content

Process JSON-RPC requests

Project description

jsonrpcserver

PyPI Code Quality Coverage Status Downloads

Process incoming JSON-RPC requests in Python.

from jsonrpcserver import method, serve, Success

@method
def ping():
    return Success("pong")

if __name__ == "__main__":
    serve()

Or use dispatch instead of serve:

response = dispatch('{"jsonrpc": "2.0", "method": "ping", "id": 1}')
# => '{"jsonrpc": "2.0", "result": "pong", "id": 1}'

Watch a video on how to use it.

Full documentation is at jsonrpcserver.com.

See also: jsonrpcclient

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-5.0.9.tar.gz (14.5 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