xlambda-redis
Managed Redis: provisioning, sub-users, backups, and a get_client()
convenience.
pip install xlambda-redis # provisioning only
pip install "xlambda-redis[client]" # plus redis-py, for get_client()
Python port of @xlambda-tech/redis.
xlambda.redis and redis-py's top-level redis coexist without shadowing
each other — Python 3 imports are absolute, so importing one never resolves
to the other.
Provisioning
from xlambda.redis import RedisClient
client = RedisClient(api_key=os.environ["XLAMBDA_API_KEY"])
instance = client.instances.create(
project_id="proj_123",
name="cache",
tier="starter", # shared; 'pro'/'business' are dedicated
persistence_mode="rdb", # 'none' | 'rdb' | 'rdb_aof'
)
create(), rotate_password(), and reveal_connection() return a
RedisInstanceHandle — a plain dict subclass, so every response field reads
normally, with client constructors added on top:
cache = instance.get_client() # redis-py, blocking
cache.set("hello", "world")
acache = instance.get_async_client() # redis.asyncio
await acache.set("hello", "world")
On shared-tier instances every key is namespaced behind instance["keyPrefix"].
reveal_connection() discloses the current password rather than changing
it. It 404s for instances that predate the feature or were created without
CONSOLE_CREDENTIAL_ENCRYPTION_KEY configured — rotate to recover.
Sub-users and backups
user = client.instances.users(instance["id"]).create(permission="readonly")
user["password"] # shown once
backups = client.instances.backups(instance["id"])
backups.create()
backups.restore("bkp_123") # overwrites all current data; cannot be undone
What this doesn't wrap
The dashboard's own command / EVAL / pub-sub browser. Running commands isn't
something the REST API mediates, so once an instance is provisioned you talk
to it with redis-py through the handle above. get_client() is a thin
ergonomic wrapper, not a reimplementation, and redis-py stays an optional
extra so provisioning-only callers don't install a driver they never use.
Async
from xlambda.redis import AsyncRedisClient
async with AsyncRedisClient(api_key=...) as client:
instance = await client.instances.create(project_id="proj_123", name="cache", tier="starter")
Note the two axes are independent: AsyncRedisClient is about the
provisioning API, get_async_client() about talking to Redis itself. You
can mix them freely.
Conventions
Arguments are snake_case; responses are the API's own camelCase, returned as
plain dicts typed by TypedDict. memoryBytes and backup sizeBytes are
bigints server-side and arrive as strings. See
xlambda-core.
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
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
File details
Details for the file xlambda_redis-0.2.0.tar.gz.
File metadata
- Download URL: xlambda_redis-0.2.0.tar.gz
- Upload date:
- Size: 7.4 kB
- Tags: Source
- Uploaded using Trusted Publishing? Yes
- Uploaded via:
twine/7.0.0 CPython/3.13.14
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
05e181d349fc7dd82176d250904aa24ef3c1c4044055134af25e0d1a1666af2b
|
|
| MD5 |
8d2b355d845769467c9a3c1d41bf0bb2
|
|
| BLAKE2b-256 |
80a2b729e4e14afa4bf1c5064eea4bccbfaacd047c0e5537f2f8393d5ca9b87a
|
Provenance
The following attestation bundles were made for xlambda_redis-0.2.0.tar.gz:
Publisher:
sdk-release-python.yml on randyryan177-cloud/media-server
-
Statement:
-
Statement type:
https://in-toto.io/Statement/v1 -
Predicate type:
https://docs.pypi.org/attestations/publish/v1 -
Subject name:
xlambda_redis-0.2.0.tar.gz -
Subject digest:
05e181d349fc7dd82176d250904aa24ef3c1c4044055134af25e0d1a1666af2b - Sigstore transparency entry: 2743440721
- Sigstore integration time:
-
Permalink:
randyryan177-cloud/media-server@52f9f31ba1bd54d30231faecd72325166d087444 -
Branch / Tag:
refs/heads/main - Owner: https://github.com/randyryan177-cloud
-
Access:
private
-
Token Issuer:
https://token.actions.githubusercontent.com -
Runner Environment:
github-hosted -
Publication workflow:
sdk-release-python.yml@52f9f31ba1bd54d30231faecd72325166d087444 -
Trigger Event:
workflow_dispatch
-
Statement type:
File details
Details for the file xlambda_redis-0.2.0-py3-none-any.whl.
File metadata
- Download URL: xlambda_redis-0.2.0-py3-none-any.whl
- Upload date:
- Size: 9.1 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? Yes
- Uploaded via:
twine/7.0.0 CPython/3.13.14
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
197486353b0cf97facf230968affdb17cbacc099415a7898a0448a4f45086b02
|
|
| MD5 |
5f42945c27b66d01ec1524a5f6c2ed73
|
|
| BLAKE2b-256 |
39629842f73753652605c335c64934839d05b2224ea022f71b5b1113f517d095
|
Provenance
The following attestation bundles were made for xlambda_redis-0.2.0-py3-none-any.whl:
Publisher:
sdk-release-python.yml on randyryan177-cloud/media-server
-
Statement:
-
Statement type:
https://in-toto.io/Statement/v1 -
Predicate type:
https://docs.pypi.org/attestations/publish/v1 -
Subject name:
xlambda_redis-0.2.0-py3-none-any.whl -
Subject digest:
197486353b0cf97facf230968affdb17cbacc099415a7898a0448a4f45086b02 - Sigstore transparency entry: 2743440949
- Sigstore integration time:
-
Permalink:
randyryan177-cloud/media-server@52f9f31ba1bd54d30231faecd72325166d087444 -
Branch / Tag:
refs/heads/main - Owner: https://github.com/randyryan177-cloud
-
Access:
private
-
Token Issuer:
https://token.actions.githubusercontent.com -
Runner Environment:
github-hosted -
Publication workflow:
sdk-release-python.yml@52f9f31ba1bd54d30231faecd72325166d087444 -
Trigger Event:
workflow_dispatch
-
Statement type: