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: about 2 months ago
JSON representation

Generate JSON-RPC requests and parse responses in Python

Awesome Lists containing this project

README

          


PyPI
Code Quality
Coverage Status
Downloads
License


Jsonrpcclient Logo


Create JSON-RPC requests and parse responses in Python


Documentation |
Developer Wiki

https://github.com/user-attachments/assets/080861a5-0819-43ec-a9e2-f8ea7eb694f5

## 🚀 Installation

```sh
pip install jsonrpcclient
```

## ⚒️ Usage

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)
```

> [!TIP]
> For strings, use `request_json` and `parse_json`.

## 📚 Documentation

👉 Full documentation is at [explodinglabs.com/jsonrpcclient/](https://explodinglabs.com/jsonrpcclient/).

👉 See the [Wiki](https://github.com/explodinglabs/jsonrpcclient/wiki) for community-editable usage examples in various frameworks, libraries, and transport protocols.

## 📖 See Also

- [jsonrpcserver](https://github.com/explodinglabs/jsonrpcserver) – Process incoming JSON-RPC requests in Python