Metadata-Version: 2.5
Name: jsonrpcclient
Version: 4.0.4
Summary: Create JSON-RPC 2.0 requests and parse responses
Keywords: json-rpc,jsonrpc,json-rpc-2.0,rpc,client
Author-email: Beau Barker <beau@explodinglabs.com>
Maintainer: bensynapse
Requires-Python: >=3.8
Description-Content-Type: text/markdown
License-Expression: MIT
Classifier: Development Status :: 5 - Production/Stable
Classifier: Intended Audience :: Developers
Classifier: Operating System :: OS Independent
Classifier: Programming Language :: Python :: 3
Classifier: Programming Language :: Python :: 3 :: Only
Classifier: Programming Language :: Python :: 3.8
Classifier: Programming Language :: Python :: 3.9
Classifier: Programming Language :: Python :: 3.10
Classifier: Programming Language :: Python :: 3.11
Classifier: Programming Language :: Python :: 3.12
Classifier: Programming Language :: Python :: 3.13
Classifier: Programming Language :: Python :: 3.14
Classifier: Programming Language :: Python :: Free Threading :: 3 - Stable
Classifier: Programming Language :: Python :: Implementation :: CPython
Classifier: Topic :: Internet
Classifier: Topic :: Software Development :: Libraries :: Python Modules
Classifier: Typing :: Typed
License-File: LICENSE
Requires-Dist: pytest ; extra == "qa"
Requires-Dist: pytest-cov ; extra == "qa"
Project-URL: Changelog, https://github.com/bensynapse/jsonrpcclient/blob/main/CHANGELOG.md
Project-URL: Documentation, https://bensynapse.github.io/jsonrpcclient/
Project-URL: Homepage, https://bensynapse.github.io/jsonrpcclient/
Project-URL: Issues, https://github.com/bensynapse/jsonrpcclient/issues
Project-URL: Repository, https://github.com/bensynapse/jsonrpcclient
Provides-Extra: qa
Import-Name: jsonrpcclient

<p align="center">
  <a href="https://pypi.org/project/jsonrpcclient/"><img src="https://img.shields.io/pypi/v/jsonrpcclient.svg" alt="PyPI" /></a>
  <a href="https://github.com/bensynapse/jsonrpcclient/actions/workflows/ci.yml"><img src="https://github.com/bensynapse/jsonrpcclient/actions/workflows/ci.yml/badge.svg" alt="CI" /></a>
  <img src="https://img.shields.io/pypi/pyversions/jsonrpcclient" alt="Python versions" />
  <img src="https://img.shields.io/pypi/dw/jsonrpcclient" alt="Downloads" />
  <img src="https://img.shields.io/github/license/bensynapse/jsonrpcclient" alt="License" />
</p>

<p align="center">
  <img alt="Jsonrpcclient Logo" src="https://raw.githubusercontent.com/bensynapse/jsonrpcclient/main/logo.png" />
</p>

<p align="center">
  <i>Create JSON-RPC requests and parse responses in Python</i>
</p>

<p align="center">
  <a href="https://bensynapse.github.io/jsonrpcclient/">Documentation</a> |
  <a href="https://bensynapse.github.io/jsonrpcclient/examples/">Examples</a> |
  <a href="https://github.com/bensynapse/jsonrpcclient/blob/main/CHANGELOG.md">Changelog</a>
</p>

[Watch the demo](https://github.com/user-attachments/assets/080861a5-0819-43ec-a9e2-f8ea7eb694f5)

## Installation

```sh
pip install jsonrpcclient
```

It has no dependencies and supports Python 3.8 and later, including
free-threaded builds.

## Usage

Generate a request:

```python
>>> from jsonrpcclient import parse, request
>>> request("ping")
{'jsonrpc': '2.0', 'method': 'ping', 'id': 1}
```

Parse a response:

```python
>>> parse({"jsonrpc": "2.0", "result": "pong", "id": 1})
Ok(result='pong', id=1)
```

For strings, use `request_json` and `parse_json`.

jsonrpcclient doesn't send anything itself. The
[examples](https://bensynapse.github.io/jsonrpcclient/examples/) show it with
requests, aiohttp, websockets and ZeroMQ.

## Documentation

Full documentation is at
[bensynapse.github.io/jsonrpcclient](https://bensynapse.github.io/jsonrpcclient/).

## See also

- [jsonrpcserver](https://github.com/bensynapse/jsonrpcserver): process incoming JSON-RPC requests in Python

