Skip to main content

JSON RPC implementation for tornado

This implementation follow JSONRPC 2.0 specification.

REQUIREMENTS

python >= 3.5 (async/await is used in the package)

INSTALLATION

pip install tornado_jsonrpc

USAGE

It is so simple:

  1. Just create views.py

     def some_view(request: RequestHandler, *args, **kwargs):  # 
         """
         args: positional params, which You pass when call jsonrpc method
         kwargs: named params, which You pass when call jsonrpc method
         """
    
         return {'foo': 'bar'}  # any JSON serializable object (dict or list for example)
    
  2. And then create tornado_app.py, where You define tornado Application:

     from tornado_jsonrpc import JSONRPCHandler
     from tornado.ioloop import IOLoop
     from tornado.web import Application
    
     from your_package import views
    
     Application(
         [
             ('/api', views.JSONRPCHandler, dict(views=views)),
         ],
     ).listen(8888)
    
     IOLoop.current().start()
    
  3. You can also use CORSIgnoreJSONRPCHandler to receive requests from all sources or WithCredentialsJSONRPCHandler to also receive cookies with request.

CONTRIBUTE

If You have found an error or want to offer changes - create a pull request, and I will review it as soon as possible!

Metadata

Release files for tornado-jsonrpc 1.0.5

For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.

Built distribution (wheel)

Table of built distributions (wheels) for tornado-jsonrpc 1.0.5
File Interpreter ABI Platform
tornado_jsonrpc-1.0.5-py2.py3-none-any.whl Python 2, Python 3 none any Details

Release files / tornado_jsonrpc-1.0.5-py2.py3-none-any.whl

Download URL tornado_jsonrpc-1.0.5-py2.py3-none-any.whl
Size 7.6 kB
Tags Python 2 Python 3
SHA-256 checksum
How to use checksums
c29191444bd0752e79e48f8b96caf02b99feb6d0ac9858c6d44fc0ffd38021ec
BLAKE2b-256 checksum
How to use checksums
cf601466035c870c2f0dea9418abaa090d25e5715e4a358d22f6a45f0062e449
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/3.4.2 importlib_metadata/4.6.4 pkginfo/1.7.1 requests/2.22.0 requests-toolbelt/0.9.1 tqdm/4.62.1 CPython/3.8.1

Security for tornado-jsonrpc 1.0.5

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.

Anthropic, PBC Visionary sponsor Bloomberg Visionary sponsor Hudson River Trading Visionary sponsor Meta Visionary sponsor NVIDIA Visionary sponsor Microsoft Sustainability sponsor Depot Continuous Integration AWS Cloud computing and Security Sponsor Datadog Monitoring Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page