skillfed

upstash-redis

Serverless Redis SDK from Upstash

upstash-redis v1.7.0 814.7K downloads/30d#4,991 on PyPI69
Permissive license MIT Active released

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 on this page — 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

upstash-redis on PyPI

pip

pip install upstash-redis

uv

uv add upstash-redis

poetry

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 the current Python release (<4.0,>=3.8)
Install friction low — pure-Python wheel
Runtime dependencies 1 — httpx
Maintenance actively maintained — 149 days since the last release
Last repo commit
First released
Downloads 814,749/month — #4,991 on PyPI (30-day window, as of 2026-08-14)
Known vulnerabilities none known (OSV.dev, checked 2026-08-14)

Evidence: upstash_redis-1.7.0-py3-none-any.whl

Keywords: Upstash Redis, Serverless Redis

Development Status :: 5 - Production/StableIntended Audience :: DevelopersLicense :: OSI Approved :: MIT LicenseOperating System :: OS IndependentProgramming Language :: PythonProgramming Language :: Python :: 3Programming Language :: Python :: 3 :: OnlyProgramming Language :: Python :: 3.10Programming Language :: Python :: 3.11Programming Language :: Python :: 3.12Programming Language :: Python :: 3.13Programming Language :: Python :: 3.14Programming Language :: Python :: 3.8Programming Language :: Python :: 3.9Programming Language :: Python :: Implementation :: CPythonTopic :: DatabaseTopic :: Database :: Front-EndsTopic :: Software Development :: Libraries

Tags

serverless redis clienthttp redis pythonupstash redis sdkconnectionless redislambda redis clientrest api redisredis without tcp
serverlessrest-apiasync-support

More Libraries packages