Skip to main content

No project description provided

Project description

Installation

pip install fastapi-jsonrpc

Usage

pip install uvicorn
import fastapi_jsonrpc as jsonrpc
from fastapi_jsonrpc import Param

app = jsonrpc.API()

api_v1 = jsonrpc.Entrypoint('/api/v1/jsonrpc')

@api_v1.method()
def echo(
    data: str = Param(..., example="123"),
) -> str:
    return data

app.bind_entrypoint(api_v1)

if __name__ == '__main__':
    import uvicorn
    uvicorn.run(app, port=5000, debug=True, access_log=False)

Go to:

http://127.0.0.1:5000/docs

Development

  1. Install poetry

    https://github.com/sdispater/poetry#installation

  2. Install dependencies

    poetry update
  3. Install dephell

    pip install dephell
  4. Regenerate setup.py

    dephell deps convert

Changelog

[0.1.3] fix README.rst

[0.1.2] Add usage example to README.rst

[0.1.1] README.rst

[0.1.0] Initial commit

Project details


Release history Release notifications | RSS feed

Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

fastapi-jsonrpc-0.1.3.tar.gz (6.6 kB view hashes)

Uploaded Source

Built Distribution

fastapi_jsonrpc-0.1.3-py3-none-any.whl (6.7 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