
# JsonRpcExtended
## Description
A remote procedure call (RPC) framework based on JSON-RPC, extended to
support alternative data formats and structures such as CSV, XML,
binary and python calls.
## Requirements
This package require:
- python3
- python3 Standard Library
- PegParser
## Installation
### Pip
```bash
python3 -m pip install JsonRpcExtended
```
### Git
```bash
git clone "https://github.com/mauricelambert/JsonRpcExtended.git"
cd "JsonRpcExtended"
python3 -m pip install .
```
### Wget
```bash
wget https://github.com/mauricelambert/JsonRpcExtended/archive/refs/heads/main.zip
unzip main.zip
cd JsonRpcExtended-main
python3 -m pip install .
```
### cURL
```bash
curl -O https://github.com/mauricelambert/JsonRpcExtended/archive/refs/heads/main.zip
unzip main.zip
cd JsonRpcExtended-main
python3 -m pip install .
```
## Usages
### Python script
```python
from JsonRpcExtended import *
from asyncio import run
server = AsyncServer("127.0.0.1", 8520)
run(server.start())
```
```python
from JsonRpcExtended import *
import socket
with socket.socket(socket.AF_INET, socket.SOCK_STREAM) as server:
server.bind(("127.0.0.1", 8520))
server.listen()
conn, addr = server.accept()
with conn:
while True:
first_byte = conn.recv(1)
protocol = get_rpc_format(first_byte)
if FORMATS.BINARY == protocol:
data = conn.recv(1024)
elif FORMATS.JSON == protocol:
file = conn.makefile(mode='rwb')
data = file.readline()
elif FORMATS.CSV == protocol:
file = conn.makefile(mode='rwb')
data = file.readline() + file.readline()
elif FORMATS.XML == protocol:
raise NotImplementedError("XML parsing is not implemented yet")
response = loading_classes[protocol].handle_request_data(first_byte + data, conn.recv)
conn.sendall(response)
```
## Links
- [Pypi](https://pypi.org/project/JsonRpcExtended)
- [Github](https://github.com/mauricelambert/JsonRpcExtended)
- [Documentation](https://mauricelambert.github.io/info/python/code/JsonRpcExtended.html)
## License
Licensed under the [GPL, version 3](https://www.gnu.org/licenses/).
Raw data
{
"_id": null,
"home_page": "https://github.com/mauricelambert/JsonRpcExtended",
"name": "JsonRpcExtended",
"maintainer": "Maurice Lambert",
"docs_url": null,
"requires_python": ">=3.8",
"maintainer_email": "Maurice Lambert <mauricelambert434@gmail.com>",
"keywords": "RPC, JSON-RPC, CSV, Protocol, py-RPC",
"author": "Maurice Lambert",
"author_email": "Maurice Lambert <mauricelambert434@gmail.com>",
"download_url": "https://files.pythonhosted.org/packages/51/cd/d7c884bd1cc657fdd285931091779bfc9cc0170bc47dc5807ced7666d047/jsonrpcextended-0.0.1.tar.gz",
"platform": "Windows",
"description": "\n\n# JsonRpcExtended\n\n## Description\n\nA remote procedure call (RPC) framework based on JSON-RPC, extended to\nsupport alternative data formats and structures such as CSV, XML,\nbinary and python calls.\n\n## Requirements\n\nThis package require:\n\n - python3\n - python3 Standard Library\n - PegParser\n\n## Installation\n\n### Pip\n\n```bash\npython3 -m pip install JsonRpcExtended\n```\n\n### Git\n\n```bash\ngit clone \"https://github.com/mauricelambert/JsonRpcExtended.git\"\ncd \"JsonRpcExtended\"\npython3 -m pip install .\n```\n\n### Wget\n\n```bash\nwget https://github.com/mauricelambert/JsonRpcExtended/archive/refs/heads/main.zip\nunzip main.zip\ncd JsonRpcExtended-main\npython3 -m pip install .\n```\n\n### cURL\n\n```bash\ncurl -O https://github.com/mauricelambert/JsonRpcExtended/archive/refs/heads/main.zip\nunzip main.zip\ncd JsonRpcExtended-main\npython3 -m pip install .\n```\n\n## Usages\n\n### Python script\n\n```python\nfrom JsonRpcExtended import *\nfrom asyncio import run\n\nserver = AsyncServer(\"127.0.0.1\", 8520)\nrun(server.start())\n```\n\n```python\n\nfrom JsonRpcExtended import *\nimport socket\n\nwith socket.socket(socket.AF_INET, socket.SOCK_STREAM) as server:\n server.bind((\"127.0.0.1\", 8520))\n server.listen()\n conn, addr = server.accept()\n with conn:\n while True:\n first_byte = conn.recv(1)\n protocol = get_rpc_format(first_byte)\n\n if FORMATS.BINARY == protocol:\n data = conn.recv(1024)\n elif FORMATS.JSON == protocol:\n file = conn.makefile(mode='rwb')\n data = file.readline()\n elif FORMATS.CSV == protocol:\n file = conn.makefile(mode='rwb')\n data = file.readline() + file.readline()\n elif FORMATS.XML == protocol:\n raise NotImplementedError(\"XML parsing is not implemented yet\")\n\n response = loading_classes[protocol].handle_request_data(first_byte + data, conn.recv)\n conn.sendall(response)\n```\n\n## Links\n\n - [Pypi](https://pypi.org/project/JsonRpcExtended)\n - [Github](https://github.com/mauricelambert/JsonRpcExtended)\n - [Documentation](https://mauricelambert.github.io/info/python/code/JsonRpcExtended.html)\n\n## License\n\nLicensed under the [GPL, version 3](https://www.gnu.org/licenses/).\n",
"bugtrack_url": null,
"license": "GPL-3.0 License",
"summary": "A remote procedure call (RPC) framework based on JSON-RPC, extended to support alternative data formats and structures such as CSV, XML, binary and python calls.",
"version": "0.0.1",
"project_urls": {
"Documentation": "https://mauricelambert.github.io/info/python/code/JsonRpcExtended.html",
"Github": "https://github.com/mauricelambert/JsonRpcExtended",
"Homepage": "https://github.com/mauricelambert/JsonRpcExtended"
},
"split_keywords": [
"rpc",
" json-rpc",
" csv",
" protocol",
" py-rpc"
],
"urls": [
{
"comment_text": null,
"digests": {
"blake2b_256": "51cdd7c884bd1cc657fdd285931091779bfc9cc0170bc47dc5807ced7666d047",
"md5": "acb383fdf2563de09f0cff9cbf640f61",
"sha256": "16fbc401ea266a923d50e4fa7cf74424a39127fb8474b3384588372cf25a48ee"
},
"downloads": -1,
"filename": "jsonrpcextended-0.0.1.tar.gz",
"has_sig": false,
"md5_digest": "acb383fdf2563de09f0cff9cbf640f61",
"packagetype": "sdist",
"python_version": "source",
"requires_python": ">=3.8",
"size": 30257,
"upload_time": "2025-09-01T04:54:15",
"upload_time_iso_8601": "2025-09-01T04:54:15.380439Z",
"url": "https://files.pythonhosted.org/packages/51/cd/d7c884bd1cc657fdd285931091779bfc9cc0170bc47dc5807ced7666d047/jsonrpcextended-0.0.1.tar.gz",
"yanked": false,
"yanked_reason": null
}
],
"upload_time": "2025-09-01 04:54:15",
"github": true,
"gitlab": false,
"bitbucket": false,
"codeberg": false,
"github_user": "mauricelambert",
"github_project": "JsonRpcExtended",
"travis_ci": false,
"coveralls": false,
"github_actions": false,
"requirements": [
{
"name": "PegParser",
"specs": []
}
],
"lcname": "jsonrpcextended"
}