Skip to main content

A Python server implementaion of JSON-RPC 2.0 over HTTP

Project description

Rufmich

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

Introduction

rufmich implements the JSON-RPC 2.0 specification with a few minor changes:

  1. The transport protocol is HTTP.
  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 to be used).

User Guide

Installation

pip install rufmich

Define methods

Create a folder with following structure:

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

An example is:

- my_methods
    - root
        root.py
        - registration
            registration.py
            - by_email
                by_email.py

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.

Examples:

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

Run

from rufmich.server import RMServer

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

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-0.1.0.tar.gz (3.1 kB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

rufmich-0.1.0-py3-none-any.whl (16.3 kB view details)

Uploaded Python 3

File details

Details for the file rufmich-0.1.0.tar.gz.

File metadata

  • Download URL: rufmich-0.1.0.tar.gz
  • Upload date:
  • Size: 3.1 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/1.13.0 pkginfo/1.5.0.1 requests/2.19.1 setuptools/41.0.1 requests-toolbelt/0.9.1 tqdm/4.32.0 CPython/3.7.3

File hashes

Hashes for rufmich-0.1.0.tar.gz
Algorithm Hash digest
SHA256 b8643f79c5af73caccd5d208201106efb7b467bf0d4114153ff9c31725b72730
MD5 7e286788a4ae390d53dfd8c10606309e
BLAKE2b-256 622767806f355a6226d41fbf575c8f45919cf338f37c0a6b20e03c7181372a08

See more details on using hashes here.

File details

Details for the file rufmich-0.1.0-py3-none-any.whl.

File metadata

  • Download URL: rufmich-0.1.0-py3-none-any.whl
  • Upload date:
  • Size: 16.3 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/1.13.0 pkginfo/1.5.0.1 requests/2.19.1 setuptools/41.0.1 requests-toolbelt/0.9.1 tqdm/4.32.0 CPython/3.7.3

File hashes

Hashes for rufmich-0.1.0-py3-none-any.whl
Algorithm Hash digest
SHA256 2a6fb3880b0da791fb20cd5baf7692acd8f600c0dd93c0460035d7149e203c4f
MD5 7ce845345f7f4dff6bbf9a5f13e3bfde
BLAKE2b-256 20e19b55719c514e345413fbc7e4e6078f9db0f2509c5b4d98548cf148b8b966

See more details on using hashes here.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Pingdom Monitoring Sentry Error logging StatusPage Status page