# orpc
Open RPC.
## Install
```
pip install orpc
```
## Client Install
```
pip install orpc-client
```
## Protocol
### oRPC request
- request_package = 4bytes-length-byteorder-big + msgstack.dumps(request_body)
- request_body = {"event": "xxx", "args": [], "kwargs": {}}
### oRPC response
- response_package = 4bytes-length-byteorder-big + msgstack.dumps(response_body)
- response_body = {"result": xx, "code": 0, "message": "xxx"}
## simple orpc server usage
### Configs
- server.listen: 0.0.0.0
- server.port 8392
- server.backlog: 8192
- server.buffer_size: 4096
- server.rfile_buffer_size: buffer_size
- server.wfile_buffer_size: buffer_size
- max_request_size: 4194304
- result_packer: zenutils.packutils.RcmPacker
- authentication.enable
- authentication.event
- authentication.users
- services
- enable-debug-service
*More configs see pypi package `daemon-application`.*
- `services` is a list of dict which item contains fields below:
- `class`: str
- `args`: list
- `kwargs`: dict
- `authentication.users` is a username and password dict.
- The `authentication.event` service takes `_protocol_instance` as a keyword parameter.
- Set `_protocol_instance.authenticated` flag to True if login success.
- The `authentication.event` service's password parameter must be given in hash format, e.g. `{SSM3}tcvAvgJqVjqC661OmZewsweDma4AOVaXruOtnCFqZrJoTllTYlNvcw==`, a salted sm3 hash.
### Command Help
```
test@testdeMacBook-Pro orpc % orpc --help
Usage: orpc [OPTIONS] COMMAND [ARGS]...
Options:
--logfmt TEXT
--logfile TEXT
--loglevel TEXT
--pidfile TEXT pidfile file path.
--workspace TEXT Set running folder
--daemon / --no-daemon Run application in background or in foreground.
-c, --config TEXT Config file path. Application will search config
file if this option is missing. Use sub-command
show-config-fileapaths to get the searching tactics.
--help Show this message and exit.
Commands:
restart Restart Daemon application.
show-config-filepaths Print out the config searching paths.
show-configs Print out the final config items.
start Start daemon application.
stop Stop daemon application.
```
## Releases
### v0.1.0
- First release.
### v0.1.2
- Add oRPC connection auto login support.
### v0.1.3
- Add auto_reconnect support for orpc-client.
Raw data
{
"_id": null,
"home_page": "",
"name": "orpc",
"maintainer": "",
"docs_url": null,
"requires_python": "",
"maintainer_email": "",
"keywords": "orpc,rpc,orpcd,NStreamExchangeProtocolBase",
"author": "zencore",
"author_email": "dobetter@zencore.cn",
"download_url": "https://files.pythonhosted.org/packages/da/85/181e7d12b4b46214386f57c82ea34bb3c7099d9e939f47d0def5af9872f4/orpc-0.1.3.tar.gz",
"platform": null,
"description": "# orpc\n\nOpen RPC.\n\n## Install\n\n```\npip install orpc\n```\n\n## Client Install\n\n```\npip install orpc-client\n```\n\n## Protocol\n\n### oRPC request\n\n- request_package = 4bytes-length-byteorder-big + msgstack.dumps(request_body)\n- request_body = {\"event\": \"xxx\", \"args\": [], \"kwargs\": {}}\n\n### oRPC response\n\n- response_package = 4bytes-length-byteorder-big + msgstack.dumps(response_body)\n- response_body = {\"result\": xx, \"code\": 0, \"message\": \"xxx\"}\n\n## simple orpc server usage\n\n### Configs\n\n- server.listen: 0.0.0.0\n- server.port 8392\n- server.backlog: 8192\n- server.buffer_size: 4096\n- server.rfile_buffer_size: buffer_size\n- server.wfile_buffer_size: buffer_size\n- max_request_size: 4194304\n- result_packer: zenutils.packutils.RcmPacker\n- authentication.enable\n- authentication.event\n- authentication.users\n- services\n- enable-debug-service\n\n*More configs see pypi package `daemon-application`.*\n\n- `services` is a list of dict which item contains fields below:\n - `class`: str\n - `args`: list\n - `kwargs`: dict\n- `authentication.users` is a username and password dict.\n- The `authentication.event` service takes `_protocol_instance` as a keyword parameter.\n- Set `_protocol_instance.authenticated` flag to True if login success.\n- The `authentication.event` service's password parameter must be given in hash format, e.g. `{SSM3}tcvAvgJqVjqC661OmZewsweDma4AOVaXruOtnCFqZrJoTllTYlNvcw==`, a salted sm3 hash.\n\n### Command Help\n\n```\ntest@testdeMacBook-Pro orpc % orpc --help\nUsage: orpc [OPTIONS] COMMAND [ARGS]...\n\nOptions:\n --logfmt TEXT\n --logfile TEXT\n --loglevel TEXT\n --pidfile TEXT pidfile file path.\n --workspace TEXT Set running folder\n --daemon / --no-daemon Run application in background or in foreground.\n -c, --config TEXT Config file path. Application will search config\n file if this option is missing. Use sub-command\n show-config-fileapaths to get the searching tactics.\n --help Show this message and exit.\n\nCommands:\n restart Restart Daemon application.\n show-config-filepaths Print out the config searching paths.\n show-configs Print out the final config items.\n start Start daemon application.\n stop Stop daemon application.\n```\n\n## Releases\n\n### v0.1.0\n\n- First release.\n\n### v0.1.2\n\n- Add oRPC connection auto login support.\n\n### v0.1.3\n\n- Add auto_reconnect support for orpc-client.\n\n\n",
"bugtrack_url": null,
"license": "MIT",
"summary": "Open RPC.",
"version": "0.1.3",
"split_keywords": [
"orpc",
"rpc",
"orpcd",
"nstreamexchangeprotocolbase"
],
"urls": [
{
"comment_text": "",
"digests": {
"md5": "13639456fe1c71a74dde63bbb85ef284",
"sha256": "918437c48df8d0d4f9523b981e580e1d3a3f5d669311a5db53349a3b98c6ba53"
},
"downloads": -1,
"filename": "orpc-0.1.3-py3-none-any.whl",
"has_sig": false,
"md5_digest": "13639456fe1c71a74dde63bbb85ef284",
"packagetype": "bdist_wheel",
"python_version": "py3",
"requires_python": null,
"size": 4756,
"upload_time": "2022-12-14T01:37:30",
"upload_time_iso_8601": "2022-12-14T01:37:30.438312Z",
"url": "https://files.pythonhosted.org/packages/ef/90/8b95cd5963c0f9345c4e1df17a72c663bcfa27c05e0d9b276a7ee7ce8360/orpc-0.1.3-py3-none-any.whl",
"yanked": false,
"yanked_reason": null
},
{
"comment_text": "",
"digests": {
"md5": "9d76549e9f084f9dc24c74bc1f6261d7",
"sha256": "2517ca72d925979c65588851996ad7a890ac88628f1bc7ab659fe31c002737eb"
},
"downloads": -1,
"filename": "orpc-0.1.3.tar.gz",
"has_sig": false,
"md5_digest": "9d76549e9f084f9dc24c74bc1f6261d7",
"packagetype": "sdist",
"python_version": "source",
"requires_python": null,
"size": 4859,
"upload_time": "2022-12-14T01:37:32",
"upload_time_iso_8601": "2022-12-14T01:37:32.765486Z",
"url": "https://files.pythonhosted.org/packages/da/85/181e7d12b4b46214386f57c82ea34bb3c7099d9e939f47d0def5af9872f4/orpc-0.1.3.tar.gz",
"yanked": false,
"yanked_reason": null
}
],
"upload_time": "2022-12-14 01:37:32",
"github": false,
"gitlab": false,
"bitbucket": false,
"lcname": "orpc"
}