--- id: upstash-redis version: "1.7.0" license: MIT license_treatment: permissive maintenance: active --- # upstash-redis — Serverless Redis SDK from Upstash License: permissive · Maintenance: active · Downloads: 814.7K/mo ## What it is and what it does upstash-redis is a Python client library that communicates with Redis through HTTP requests to the Upstash REST API rather than establishing direct TCP connections. It's purpose-built for serverless platforms where persistent TCP connections are impractical or unavailable, such as AWS Lambda, Vercel, and Google Cloud Functions. The library provides both synchronous and asynchronous interfaces, supporting standard Redis commands including streams, pipelines, transactions, and custom commands. The package depends only on httpx for HTTP communication and requires Python 3.8 or later. It handles connection credentials via environment variables or explicit parameters, includes automatic retry logic with configurable intervals, and supports optional base64 encoding for data serialization. The library is in GA stage and receives regular maintenance and bug fixes from Upstash's professional support team. Use it for: - Cache layer in AWS Lambda functions where TCP connections are ephemeral or cost-prohibitive. - Session storage in Vercel serverless functions using Redis Streams for real-time data handling. - Distributed task queues in Google Cloud Functions leveraging Redis pipelines and transactions. - Rate limiting and counters in serverless APIs without managing persistent connection pools. - Real-time event processing with Redis Streams consumer groups in containerized serverless environments. ## Worth the install? AI-flagged interpretation of the facts above — verify before relying. HTTP-based Redis client for Python that connects to Upstash Redis via REST API instead of TCP, designed for serverless environments like AWS Lambda and Google Cloud Functions. Yes. The package is actively maintained, has no known vulnerabilities, installs with minimal friction (one dependency), and fills a genuine gap for serverless Python applications needing Redis. The MIT license imposes no restrictions. Install it if you're building on serverless platforms and need Redis caching or data structures; skip it if you have persistent TCP connectivity and prefer the lower latency of direct Redis connections. ## Install pip install upstash-redis uv add upstash-redis poetry add upstash-redis ## Installing upstash-redis Before you install: Low friction: single runtime dependency (httpx), pure Python wheel, actively maintained with recent commits and regular updates under Upstash Professional Support. License in practice: MIT license permits commercial and private use with minimal restrictions; you may use, modify, and distribute this package freely provided you include the license notice. Quickstart: pip install upstash-redis from upstash_redis import Redis redis = Redis.from_env() redis.set("key", "value") print(redis.get("key")) Requires UPSTASH_REDIS_REST_URL and UPSTASH_REDIS_REST_TOKEN environment variables or explicit url/token parameters; an active Upstash Redis database is required. Verify before relying: - Performance characteristics compared to TCP-based Redis clients in non-serverless environments. - Whether the retry mechanism (default: one retry after 3 seconds) is configurable for specific use cases. - Telemetry data collection scope and whether it impacts privacy-sensitive deployments. ## Package facts - License: MIT (permissive) - Python support: supports_current - Install friction: low - Maintenance: active - Downloads: 814.7K/month (top 5,000 on PyPI) - Known vulnerabilities: none known ## Tags serverless redis client, http redis python, upstash redis sdk, connectionless redis, lambda redis client, rest api redis, redis without tcp, serverless, rest-api, async-support [View on SkillFed](https://skillfed.io/packages/upstash-redis) · [View on PyPI](https://pypi.org/project/upstash-redis/)