Upstash Python SDK

1.2.0 · active · verified Tue Mar 17

Unified Python SDK for Upstash cloud services including Redis, Vector, QStash, and Workflow. Provides serverless-friendly clients optimized for edge and serverless environments with HTTP-based connections. Replaces the older individual packages (upstash-redis, upstash-vector, upstash-qstash).

Warnings

Install

Imports

Quickstart

Minimal Redis set/get using the Upstash Redis client with HTTP-based connection.

import os
from upstash_redis import Redis

redis = Redis(
    url=os.environ.get('UPSTASH_REDIS_REST_URL', ''),
    token=os.environ.get('UPSTASH_REDIS_REST_TOKEN', '')
)

redis.set('greeting', 'Hello from Upstash!')
value = redis.get('greeting')
print(value)

view raw JSON →