Skip to main content

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

Metadata

Release files for retoolrpc 0.1.2

For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.

Source distribution (sdist)

Source distribution for retoolrpc 0.1.2
File Size Uploaded
retoolrpc-0.1.2.tar.gz 9.7 kB Details

Built distribution (wheel)

Table of built distributions (wheels) for retoolrpc 0.1.2
File Interpreter ABI Platform
retoolrpc-0.1.2-py3-none-any.whl Python 3 none any Details

Total release size: 21.6 kB

Release files / retoolrpc-0.1.2.tar.gz

Download URL retoolrpc-0.1.2.tar.gz
Size 9.7 kB
Tags Source
SHA-256 checksum
How to use checksums
52379a1b653fe5f0c8830dae823d898c4a637ea8111921635fea493153bbfbbd
BLAKE2b-256 checksum
How to use checksums
0ec89914aec479826386abc0325ea468bdefb7fd55c31278bfafe96acc8805e1
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via poetry/1.6.1 CPython/3.10.13 Darwin/21.6.0

Release files / retoolrpc-0.1.2-py3-none-any.whl

Download URL retoolrpc-0.1.2-py3-none-any.whl
Size 11.9 kB
Tags Python 3
SHA-256 checksum
How to use checksums
1c49506f2292e8513ee7b9525d46f120b1464eeee8cb0bc38ccc0fc7bc009407
BLAKE2b-256 checksum
How to use checksums
bec8509438a6fe8d900b03d2441edfff7c5e0488f9c42b7624be42b99a17ed82
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via poetry/1.6.1 CPython/3.10.13 Darwin/21.6.0

Release history Release notifications | RSS feed

This release

0.1.2 This release

2 release files

0.1.1

2 release files

0.1.0

2 release files

Anthropic, PBC Visionary sponsor Bloomberg Visionary sponsor Hudson River Trading Visionary sponsor Meta Visionary sponsor NVIDIA Visionary sponsor Microsoft Sustainability sponsor Depot Continuous Integration AWS Cloud computing and Security Sponsor Datadog Monitoring Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page