Python package for Retool RPC
Project description
retoolrpc Python client package
Review Retool's RPC documentation before installing the JavaScript package.
Installation
Use pip or poetry to install the packages.
# Using pip
pip install retoolrpc asyncio
# Using poetry
poetry init
poetry add retoolrpc asyncio
Usage example
import asyncio
from retoolrpc import RetoolRPC, RetoolRPCConfig
async def start_rpc():
rpc_config = RetoolRPCConfig(
api_token="your-api-token-here", # Replace this token with your API token
host="http://localhost:3000/", # Replace this host with your host domain
resource_id="resource-id", # Replace this resource ID with your ID
environment_name="production", # Replace this environment name with your name (defaults to production)
polling_interval_ms=1000, # The polling interval for the RPC
version="0.0.1", # An optional version number for functions schemas
log_level="info", # Change to 'debug' for verbose logging
)
rpc = RetoolRPC(rpc_config)
def helloWorld(args, context):
return f"Hello {args['name']}!"
rpc.register(
{
"name": "helloWorld",
"arguments": {
"name": {
"type": "string",
"description": "Your name",
"required": True,
"array": False,
},
},
"implementation": helloWorld,
"permissions": None,
}
)
await rpc.listen()
if __name__ == "__main__":
asyncio.run(start_rpc())
Project details
Release history Release notifications | RSS feed
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
retoolrpc-0.1.2.tar.gz
(9.7 kB
view details)
Built Distribution
Filter files by name, interpreter, ABI, and platform.
If you're not sure about the file name format, learn more about wheel file names.
Copy a direct link to the current filters
retoolrpc-0.1.2-py3-none-any.whl
(11.9 kB
view details)
File details
Details for the file retoolrpc-0.1.2.tar.gz.
File metadata
- Download URL: retoolrpc-0.1.2.tar.gz
- Upload date:
- Size: 9.7 kB
- Tags: Source
- Uploaded using Trusted Publishing? No
- Uploaded via: poetry/1.6.1 CPython/3.10.13 Darwin/21.6.0
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
52379a1b653fe5f0c8830dae823d898c4a637ea8111921635fea493153bbfbbd
|
|
| MD5 |
ee3fbed86a3436c707ac52e41982130d
|
|
| BLAKE2b-256 |
0ec89914aec479826386abc0325ea468bdefb7fd55c31278bfafe96acc8805e1
|
File details
Details for the file retoolrpc-0.1.2-py3-none-any.whl.
File metadata
- Download URL: retoolrpc-0.1.2-py3-none-any.whl
- Upload date:
- Size: 11.9 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? No
- Uploaded via: poetry/1.6.1 CPython/3.10.13 Darwin/21.6.0
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
1c49506f2292e8513ee7b9525d46f120b1464eeee8cb0bc38ccc0fc7bc009407
|
|
| MD5 |
968e634f13df06bcdc884f9ec5ae2ec7
|
|
| BLAKE2b-256 |
bec8509438a6fe8d900b03d2441edfff7c5e0488f9c42b7624be42b99a17ed82
|