Skip to main content

A Python server implementaion of JSON-RPC 2.0 over HTTP

Project description


A Python server implementaion of JSON-RPC 2.0 over HTTP.


rufmich is an HTTP server for JSON-RPC 2.0. To make the JSON-RPC 2.0 work over HTTP, following specifications are added:

  1. The transport protocol is HTTP. The response for an notification is an HTTP response with status code 204 (No Response) and empty content. The HTTP requests must have the header content-type: application/json, otherwise there will be an HTTP error 415 (Unsupported Media Type).
  2. A notification request will get an immediate response. Usually the server will start the procedure and return the response immediately (without having to wait for the procedure to finish). And there is no callback for the procedure, which means the client would not be aware of any errors.
  3. Method namespacing is supported (and recommended).


Notification is implemented using threading. A method without id will be invoked in a new thread.


If multiple requests are sent in a batch, they will be processed concurrently by a thread pool.

User Guide


pip install rufmich

Define methods

Create a folder with following structure:

- <your_methods_workspace>
    - root
        - <A>
            - <B>
        - <C>

An example is:

- my_methods
    - root
        - registration
            - by_email

Note that there MUST BE a directory named root under your workspace folder.

Each namespace folder MUST HAVE a .py file with the same name as the folder. The methods defined in those .py files will be indexed according to the folder hierarchy.


  1. A method foobar defined in is indexed to "foobar" and "::foobar"
  2. A method send_code_to_email defined in in the above example is indexed to "registration::by_email::send_code_to_email" (and "::registration::by_email::send_code_to_email")


from rufmich.server import RMServer

server = RMServer(load_path=<your_methods_workspace>)<port>)

Client examples

Check on the website of JSON-RPC 2.0 Specification.

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

rufmich-1.0.2.tar.gz (3.9 kB view hashes)

Uploaded Source

Built Distribution

rufmich-1.0.2-py3-none-any.whl (17.1 kB view hashes)

Uploaded Python 3

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