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.
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 install —
pip install envshed(oruv add envshed) gives you a typed client and aload_env()helper. - Drop-in for
python-dotenv—from envshed import load_env; load_env(env="production")populatesos.environfrom the live vault, so existingos.environ["DATABASE_URL"]reads keep working. - Sync and async — the same client exposes
ClientandAsyncClientso 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.
Related
envshed run— the CLI command both workarounds rely onenvshed pull— for thedotenvfile pattern- Service tokens — what to give your worker pods
- Public roadmap