Connecting to your Rice serverless backend is simple. The Python SDK supports multiple transport protocols to optimize for different use cases, abstracting most complexity while giving you control when needed.
Rice is currently in beta. Please install the client directly from the repository:
# Standard installation (HTTP support)
pip install git+https://github.com/rice-ai-hq/ricedb-python
# Recommended for production (adds gRPC support)
pip install "git+https://github.com/rice-ai-hq/ricedb-python#egg=ricedb[grpc]"
The RiceDBClient will automatically attempt to connect using the best available transport (gRPC if available, otherwise HTTP).
from ricedb import RiceDBClient
# Connect to your instance host
# Note: Do not include http:// or https:// prefix
client = RiceDBClient("xyz-123.ricedb.cloud")
client.connect()
# Login to get an access token
client.login("admin", "your_password")
# Force HTTP mode
client = RiceDBClient("xyz-123.ricedb.cloud", transport="http", port=3000)
# Force gRPC mode
client = RiceDBClient("xyz-123.ricedb.cloud", transport="grpc", port=50051)
admin) and password.ricedb[grpc] is installed.