Thin convenience overDocumentation Index
Fetch the complete documentation index at: https://docs.cirron.com/llms.txt
Use this file to discover all available pages before exploring further.
os.environ with .env file loading and
automatic JSON parsing for structured values. Not a proprietary
config system; ci.env(key) is functionally os.environ.get(key)
plus two ergonomic additions.
Signature
Parameters
| Name | Type | Default | Purpose |
|---|---|---|---|
key | str | - | Environment variable name |
default | any | None | Returned when the key is absent |
Behavior
.envloading: on first call, loads a.envfile from the current working directory viapython-dotenvif that package is installed. Ifpython-dotenvisn’t installed,.envloading is silently skipped;os.environis read directly.- JSON auto-parsing: values whose first non-whitespace character
is
{or[are parsed withjson.loads(). Scalars (numbers,"true","false", plain strings) stay as strings; cast them yourself. This avoids surprises like"123"becoming anintyou didn’t expect.
Examples
Plain env vars
Structured config
Platform context
The Cirron runtime injects these automatically inside pipelines and deployments:| Variable | Purpose |
|---|---|
CIRRON_RUN_ID | Run this process belongs to |
CIRRON_PIPELINE_ID | Pipeline this run executed as (if any) |
CIRRON_DEPLOYMENT_ID | Deployment this process is part of (if any) |
CIRRON_WORKSPACE_ID | Owning workspace |
ci.env() reads them like any other variable. ci.profile() reads
them internally to set span attribution and pick the transport.
Updating values on the deployment
On the deployment config panel in the Cirron platform dashboard, edit an env var and hit apply. The platform triggers a rolling restart of the deployment’s containers with the new values. There is a brief pause per replica, not zero-downtime. The next call toci.env() after restart returns the updated value; the SDK doesn’t
cache env values, so no additional invalidation step is needed.
Alternatives
ci.env() is a convenience, not a requirement. os.environ.get(),
python-decouple, and pydantic-settings all work fine with the
SDK.
Related
ci.secret
For credentials. Never pass a secret through
ci.env.Configuration guide
Full resolution order: explicit → env →
config.toml → defaults.