Skip to main content

Python SDK

A first-party envshed package for Python — fetch secrets from your Django, FastAPI, or script entry points without shelling out to the CLI.

On the roadmap — target Q3 2026

The Python SDK ships in Q3 2026 with sync and async clients, typed responses, and a load_dotenv()-style helper. Until then, Python projects get the same behavior through the CLI or the REST API.

How it will work

  • One installpip install envshed (or uv add envshed) gives you a typed client and a load_env() helper.
  • Drop-in for python-dotenvfrom envshed import load_env; load_env(env="production") populates os.environ from the live vault, so existing os.environ["DATABASE_URL"] reads keep working.
  • Sync and async — the same client exposes Client and AsyncClient so FastAPI and Django both work without wrapping calls.
  • Local cache — opt-in on-disk cache for restricted networks, encrypted with the same envelope the CLI uses.

Workaround today

Two patterns work in production today and will keep working after the SDK ships.

Option 1 — envshed run wraps your Python entry point

The cleanest pattern. No code changes — envshed run injects every secret as an env var, your code keeps reading os.environ["DATABASE_URL"].

envshed run -e production -- python manage.py runserver
envshed run -e production -- uvicorn app.main:app
envshed run -e production -- python scripts/backfill.py

This works for one-off scripts, web servers, Celery workers, and anything else that reads from os.environ at startup.

Option 2 — envshed pull writes a file python-dotenv already understands

If you already use python-dotenv and want to keep the import:

envshed pull -e production

That writes .env in the same KEY=value shape python-dotenv already reads.

Then in code:

from dotenv import load_dotenv
load_dotenv()

This is the lowest-friction migration path for an app already using python-dotenv — you replace the source of truth, not the loader.

Option 3 — call the REST API directly

For workers running in restricted environments where you cannot install the CLI, the REST API returns the same payload the CLI uses. See the existing curl examples in snapshots and service tokens for the request shape.

Want this sooner?

Python is on the public roadmap right after the Vercel integration. If the SDK would unblock you, email hello@envshed.com with a line about your stack (Django, FastAPI, Flask, scripts, something else) — it helps us prioritize the API surface to ship first.