https://github.com/explodinglabs/jsonrpcserver
Process incoming JSON-RPC requests in Python
https://github.com/explodinglabs/jsonrpcserver
api json-rpc python
Last synced: about 1 month ago
JSON representation
Process incoming JSON-RPC requests in Python
- Host: GitHub
- URL: https://github.com/explodinglabs/jsonrpcserver
- Owner: explodinglabs
- License: mit
- Created: 2015-11-01T23:51:59.000Z (over 9 years ago)
- Default Branch: main
- Last Pushed: 2023-05-31T01:16:14.000Z (almost 2 years ago)
- Last Synced: 2024-04-30T00:02:51.571Z (about 1 year ago)
- Topics: api, json-rpc, python
- Language: Python
- Homepage: https://www.jsonrpcserver.com
- Size: 1.12 MB
- Stars: 184
- Watchers: 7
- Forks: 39
- Open Issues: 13
-
Metadata Files:
- Readme: README.md
- Changelog: CHANGELOG.md
- License: LICENSE
Awesome Lists containing this project
README




Process incoming JSON-RPC requests in Python.
```sh
pip install jsonrpcserver
``````python
from jsonrpcserver import method, serve, Success@method
def ping():
return Success("pong")if __name__ == "__main__":
serve()
```Or use `dispatch` instead of `serve`:
```python
response = dispatch('{"jsonrpc": "2.0", "method": "ping", "id": 1}')
# => '{"jsonrpc": "2.0", "result": "pong", "id": 1}'
```[Watch a video on how to use it.](https://www.youtube.com/watch?v=3_BMmgJaFHQ)
Full documentation is at [jsonrpcserver.com](https://www.jsonrpcserver.com/).
See also: [jsonrpcclient](https://github.com/explodinglabs/jsonrpcclient)