Skip to main content

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

xlambda_redis-0.2.0.tar.gz (7.4 kB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

xlambda_redis-0.2.0-py3-none-any.whl (9.1 kB view details)

Uploaded Python 3

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

Hashes for xlambda_redis-0.2.0.tar.gz
Algorithm Hash digest
SHA256 05e181d349fc7dd82176d250904aa24ef3c1c4044055134af25e0d1a1666af2b
MD5 8d2b355d845769467c9a3c1d41bf0bb2
BLAKE2b-256 80a2b729e4e14afa4bf1c5064eea4bccbfaacd047c0e5537f2f8393d5ca9b87a

See more details on using hashes here.

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

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

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

Hashes for xlambda_redis-0.2.0-py3-none-any.whl
Algorithm Hash digest
SHA256 197486353b0cf97facf230968affdb17cbacc099415a7898a0448a4f45086b02
MD5 5f42945c27b66d01ec1524a5f6c2ed73
BLAKE2b-256 39629842f73753652605c335c64934839d05b2224ea022f71b5b1113f517d095

See more details on using hashes here.

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

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

Release history Release notifications | RSS feed

This release

0.2.0 This release

2 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