Python bindings for Redis Enterprise REST API client
Project description
redis-enterprise
A comprehensive Rust client library for the Redis Enterprise REST API, with Python bindings.
Features
- Complete coverage of Redis Enterprise REST API endpoints
- Async/await support with tokio
- Strong typing for API requests and responses
- Comprehensive error handling
- Optional Tower service integration for middleware composition
- Support for all Redis Enterprise features including:
- Cluster management and bootstrap
- Database (BDB) operations
- Node management and statistics
- User and role management
- Redis modules
- Active-Active (CRDB) databases
- Monitoring and alerts
Installation
[dependencies]
redis-enterprise = "0.7"
# Optional: Enable Tower service integration
redis-enterprise = { version = "0.7", features = ["tower-integration"] }
Quick Start
use redis_enterprise::EnterpriseClient;
#[tokio::main]
async fn main() -> Result<(), Box<dyn std::error::Error>> {
// Create client using builder pattern
let client = EnterpriseClient::builder()
.base_url("https://cluster.example.com:9443")
.username("admin@example.com")
.password("your-password")
.insecure(false) // Set to true for self-signed certificates
.build()?;
// Get cluster information
let cluster = client.cluster().info().await?;
println!("Cluster: {:?}", cluster);
// List databases (BDBs)
let databases = client.databases().list().await?;
println!("Databases: {:?}", databases);
// Get node statistics
let nodes = client.nodes().list().await?;
println!("Nodes: {:?}", nodes);
Ok(())
}
Tower Integration
Enable the tower-integration feature to use the client with Tower middleware:
use redis_enterprise::EnterpriseClient;
use redis_enterprise::tower_support::ApiRequest;
use tower::ServiceExt;
#[tokio::main]
async fn main() -> Result<(), Box<dyn std::error::Error>> {
let client = EnterpriseClient::builder()
.base_url("https://localhost:9443")
.username("admin")
.password("password")
.insecure(true)
.build()?;
// Convert to a Tower service
let mut service = client.into_service();
// Use the service
let response = service
.oneshot(ApiRequest::get("/v1/cluster"))
.await?;
println!("Response: {:?}", response.body);
Ok(())
}
This enables composition with Tower middleware like circuit breakers, retry, rate limiting, and more.
Python Bindings
This library also provides Python bindings via PyO3:
pip install redis-enterprise
from redis_enterprise import EnterpriseClient
# Create client
client = EnterpriseClient(
base_url="https://cluster:9443",
username="admin@redis.local",
password="secret",
insecure=True # For self-signed certs
)
# Or from environment variables
client = EnterpriseClient.from_env()
# Async usage
async def main():
dbs = await client.databases()
for db in dbs:
print(db["name"], db["uid"])
# Sync usage
dbs = client.databases_sync()
Python API
EnterpriseClient(base_url, username, password, insecure=False, timeout_secs=None)EnterpriseClient.from_env()- Create from environment variables
Cluster
cluster_info()/cluster_info_sync()- Get cluster infocluster_stats()/cluster_stats_sync()- Get cluster statisticslicense()/license_sync()- Get license info
Databases
databases()/databases_sync()- List all databasesdatabase(uid)/database_sync(uid)- Get database by UID
Nodes
nodes()/nodes_sync()- List all nodesnode(uid)/node_sync(uid)- Get node by UID
Users
users()/users_sync()- List all users
Raw API
get(path)/get_sync(path)- Raw GET requestpost(path, body)/post_sync(path, body)- Raw POST requestdelete(path)/delete_sync(path)- Raw DELETE request
Environment Variables
REDIS_ENTERPRISE_URL- Base URL (default: https://localhost:9443)REDIS_ENTERPRISE_USER- UsernameREDIS_ENTERPRISE_PASSWORD- PasswordREDIS_ENTERPRISE_INSECURE- Set to "true" for self-signed certs
API Coverage
This library provides 100% coverage of the Redis Enterprise REST API, including:
- Cluster Operations - Bootstrap, configuration, topology
- Database Management - CRUD operations, actions, statistics
- Node Management - Add/remove nodes, statistics, actions
- Security - Users, roles, ACLs, LDAP integration
- Modules - Upload and manage Redis modules
- Monitoring - Stats, alerts, logs, diagnostics
- Active-Active - CRDB management and tasks
- Administration - License, certificates, services
Documentation
License
Licensed under either of
- Apache License, Version 2.0 (LICENSE-APACHE or http://www.apache.org/licenses/LICENSE-2.0)
- MIT license (LICENSE-MIT or http://opensource.org/licenses/MIT)
at your option.
Project details
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
Built Distributions
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
File details
Details for the file redis_enterprise-0.8.3.tar.gz.
File metadata
- Download URL: redis_enterprise-0.8.3.tar.gz
- Upload date:
- Size: 174.2 kB
- Tags: Source
- Uploaded using Trusted Publishing? Yes
- Uploaded via: twine/6.1.0 CPython/3.13.7
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
c9b61eab715661d2b6a4e7ca94c4fa0b7306c0fa412c487f02b07808ff4c825e
|
|
| MD5 |
55a0487bde7a71d3e8e023fae81016a6
|
|
| BLAKE2b-256 |
03a2011da7684c068ed21cdcf3247a15e2086ac65d4417e914625b7209aeeabb
|
Provenance
The following attestation bundles were made for redis_enterprise-0.8.3.tar.gz:
Publisher:
python.yml on redis-developer/redis-enterprise-rs
-
Statement:
-
Statement type:
https://in-toto.io/Statement/v1 -
Predicate type:
https://docs.pypi.org/attestations/publish/v1 -
Subject name:
redis_enterprise-0.8.3.tar.gz -
Subject digest:
c9b61eab715661d2b6a4e7ca94c4fa0b7306c0fa412c487f02b07808ff4c825e - Sigstore transparency entry: 937008773
- Sigstore integration time:
-
Permalink:
redis-developer/redis-enterprise-rs@23009fb66e596a93c871e3fc5ca6cbff95a0a51c -
Branch / Tag:
refs/tags/v0.8.5 - Owner: https://github.com/redis-developer
-
Access:
public
-
Token Issuer:
https://token.actions.githubusercontent.com -
Runner Environment:
github-hosted -
Publication workflow:
python.yml@23009fb66e596a93c871e3fc5ca6cbff95a0a51c -
Trigger Event:
release
-
Statement type:
File details
Details for the file redis_enterprise-0.8.3-cp312-cp312-win_amd64.whl.
File metadata
- Download URL: redis_enterprise-0.8.3-cp312-cp312-win_amd64.whl
- Upload date:
- Size: 2.6 MB
- Tags: CPython 3.12, Windows x86-64
- Uploaded using Trusted Publishing? Yes
- Uploaded via: twine/6.1.0 CPython/3.13.7
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
3862d24aa4bc444280182d7eccad0d515aecb217dc2ca35f62f5f53275a37bc9
|
|
| MD5 |
ff120cd21702a20c3ab52f2e35491d76
|
|
| BLAKE2b-256 |
298898c35c08bf30040b27f2e951469b2b71dc24fa14ef2a4a11abcc2aab07a7
|
Provenance
The following attestation bundles were made for redis_enterprise-0.8.3-cp312-cp312-win_amd64.whl:
Publisher:
python.yml on redis-developer/redis-enterprise-rs
-
Statement:
-
Statement type:
https://in-toto.io/Statement/v1 -
Predicate type:
https://docs.pypi.org/attestations/publish/v1 -
Subject name:
redis_enterprise-0.8.3-cp312-cp312-win_amd64.whl -
Subject digest:
3862d24aa4bc444280182d7eccad0d515aecb217dc2ca35f62f5f53275a37bc9 - Sigstore transparency entry: 937008777
- Sigstore integration time:
-
Permalink:
redis-developer/redis-enterprise-rs@23009fb66e596a93c871e3fc5ca6cbff95a0a51c -
Branch / Tag:
refs/tags/v0.8.5 - Owner: https://github.com/redis-developer
-
Access:
public
-
Token Issuer:
https://token.actions.githubusercontent.com -
Runner Environment:
github-hosted -
Publication workflow:
python.yml@23009fb66e596a93c871e3fc5ca6cbff95a0a51c -
Trigger Event:
release
-
Statement type:
File details
Details for the file redis_enterprise-0.8.3-cp312-cp312-macosx_11_0_arm64.whl.
File metadata
- Download URL: redis_enterprise-0.8.3-cp312-cp312-macosx_11_0_arm64.whl
- Upload date:
- Size: 3.0 MB
- Tags: CPython 3.12, macOS 11.0+ ARM64
- Uploaded using Trusted Publishing? Yes
- Uploaded via: twine/6.1.0 CPython/3.13.7
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
c1beb814097dcf1b9282d877defd47d97bbd4610a4f661ce65ae702298d1db71
|
|
| MD5 |
002da2303285e73d499c3caeb5e7da51
|
|
| BLAKE2b-256 |
280aa23d119070b8f4da392ff60f01904b41a2e9c181acd7f24ef33cfd48ec77
|
Provenance
The following attestation bundles were made for redis_enterprise-0.8.3-cp312-cp312-macosx_11_0_arm64.whl:
Publisher:
python.yml on redis-developer/redis-enterprise-rs
-
Statement:
-
Statement type:
https://in-toto.io/Statement/v1 -
Predicate type:
https://docs.pypi.org/attestations/publish/v1 -
Subject name:
redis_enterprise-0.8.3-cp312-cp312-macosx_11_0_arm64.whl -
Subject digest:
c1beb814097dcf1b9282d877defd47d97bbd4610a4f661ce65ae702298d1db71 - Sigstore transparency entry: 937008778
- Sigstore integration time:
-
Permalink:
redis-developer/redis-enterprise-rs@23009fb66e596a93c871e3fc5ca6cbff95a0a51c -
Branch / Tag:
refs/tags/v0.8.5 - Owner: https://github.com/redis-developer
-
Access:
public
-
Token Issuer:
https://token.actions.githubusercontent.com -
Runner Environment:
github-hosted -
Publication workflow:
python.yml@23009fb66e596a93c871e3fc5ca6cbff95a0a51c -
Trigger Event:
release
-
Statement type:
File details
Details for the file redis_enterprise-0.8.3-cp38-cp38-manylinux_2_17_x86_64.manylinux2014_x86_64.whl.
File metadata
- Download URL: redis_enterprise-0.8.3-cp38-cp38-manylinux_2_17_x86_64.manylinux2014_x86_64.whl
- Upload date:
- Size: 3.3 MB
- Tags: CPython 3.8, manylinux: glibc 2.17+ x86-64
- Uploaded using Trusted Publishing? Yes
- Uploaded via: twine/6.1.0 CPython/3.13.7
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
b055c313f9572fbe9e93b1a9df6dd365d343b505369fd9b9714c0b7b72542073
|
|
| MD5 |
54dd7afedf5a197e49f2cc75405b81ff
|
|
| BLAKE2b-256 |
f98e76533e01a23662ba4711b9bc890d8f1bbb80a587f3769b50a6131c5f7d0f
|
Provenance
The following attestation bundles were made for redis_enterprise-0.8.3-cp38-cp38-manylinux_2_17_x86_64.manylinux2014_x86_64.whl:
Publisher:
python.yml on redis-developer/redis-enterprise-rs
-
Statement:
-
Statement type:
https://in-toto.io/Statement/v1 -
Predicate type:
https://docs.pypi.org/attestations/publish/v1 -
Subject name:
redis_enterprise-0.8.3-cp38-cp38-manylinux_2_17_x86_64.manylinux2014_x86_64.whl -
Subject digest:
b055c313f9572fbe9e93b1a9df6dd365d343b505369fd9b9714c0b7b72542073 - Sigstore transparency entry: 937008783
- Sigstore integration time:
-
Permalink:
redis-developer/redis-enterprise-rs@23009fb66e596a93c871e3fc5ca6cbff95a0a51c -
Branch / Tag:
refs/tags/v0.8.5 - Owner: https://github.com/redis-developer
-
Access:
public
-
Token Issuer:
https://token.actions.githubusercontent.com -
Runner Environment:
github-hosted -
Publication workflow:
python.yml@23009fb66e596a93c871e3fc5ca6cbff95a0a51c -
Trigger Event:
release
-
Statement type: