Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/explodinglabs/jsonrpcclient
Generate JSON-RPC requests and parse responses in Python
https://github.com/explodinglabs/jsonrpcclient
api client json-rpc python rpc
Last synced: 5 days ago
JSON representation
Generate JSON-RPC requests and parse responses in Python
- Host: GitHub
- URL: https://github.com/explodinglabs/jsonrpcclient
- Owner: explodinglabs
- License: mit
- Created: 2015-11-01T23:54:50.000Z (about 9 years ago)
- Default Branch: main
- Last Pushed: 2023-12-29T12:11:44.000Z (12 months ago)
- Last Synced: 2024-12-15T00:06:38.701Z (12 days ago)
- Topics: api, client, json-rpc, python, rpc
- Language: Python
- Homepage: https://www.jsonrpcclient.com
- Size: 852 KB
- Stars: 116
- Watchers: 5
- Forks: 46
- Open Issues: 3
-
Metadata Files:
- Readme: README.md
- Changelog: CHANGELOG.md
- License: LICENSE
Awesome Lists containing this project
README
![PyPI](https://img.shields.io/pypi/v/jsonrpcclient.svg)
![Code Quality](https://github.com/explodinglabs/jsonrpcclient/actions/workflows/code-quality.yml/badge.svg)
![Coverage Status](https://coveralls.io/repos/github/explodinglabs/jsonrpcclient/badge.svg?branch=main)
![Downloads](https://img.shields.io/pypi/dw/jsonrpcclient)Create JSON-RPC requests and parse responses in Python.
```sh
pip install jsonrpcclient
```Generate a request:
```python
from jsonrpcclient import request, parse
req = request("ping")
# => {'jsonrpc': '2.0', 'method': 'ping', 'id': 1}
```Parse a response:
```python
parsed = parse({"jsonrpc": "2.0", "result": "pong", "id": 1})
# => Ok(result='pong', id=1)
```
For strings, use `request_json` and `parse_json`.[Watch a video on how to use it](https://www.youtube.com/watch?v=PxQagaZ0PsY)
Full documentation is at [jsonrpcclient.com](https://www.jsonrpcclient.com/).
See also: [jsonrpcserver](https://github.com/explodinglabs/jsonrpcserver)