Skip to main content

envbox

https://github.com/idlesign/envbox

PyPI - Version License Coverage Docs

Description

Detect environment type and work within.

Features

  • Environment type detection (extendable system);
  • Support for .env files;
  • Convenient os.environ proxying (with optional values casting into Python natives);
  • Automatic submodule-for-environment import tool;
  • Cosy per-thread settings container with environment var support;
  • CLI for environment probing.

Code sample

from envbox import get_environment

# Detect current environment type
# and get its object.
#
# Default detection sources:
# 1. ``PYTHON_ENV`` env variable
# 2. ``environment`` file contents
#
# By default this function will also try to read env variables from .env files.
env = get_environment()

env.name
# >> development

env.is_production
# >> False

env.get('HOME')  # The same as env['HOME'] and env.HOME
# >> /home/idle/

env.getmany('PYTHON')
# {'UNBUFFERED': '1', 'IOENCODING': 'UTF-8', 'PATH': ...}

.env files

Now you may want to put your environment vars into .env files (e.g.: .env, .env.development .env.production) to be read by envbox:

MY_VAR_1=value1
HOME=/home/other/

# comments are ignored, just as lines without definitions

# mathing quotes (" and ') are stripped
MY_QUOTED="some quoted "

# ${VARNAME} will be replaced by value from env (if available)
MY_VAR_2="${MY_QUOTED}"

# multiline with dangling quotes
MULTI_1="
line1
line2
"

# multiline classic
MULTI_2="line1
line2
line3"

# multiline as one line
MULTI_3="one\ntwo"

Read the docs for more examples.

CLI

$ envbox probe
# >> Detected environment type: development (Development)

$ envbox show
# >> [...]
# >> MY_API_TOKEN = ******
# >> SHELL = /bin/bash
# >> [...]

!!! note envbox show masks sensitive values (passwords, tokens, keys, secrets). Use --secrets flag to show them unmasked.

!!! note envbox CLI requires click package available.

Documentation

https://envbox.readthedocs.io/

Metadata

Release files for envbox 2.1.0

For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.

Source distribution (sdist)

Source distribution for envbox 2.1.0
File Size Uploaded Provenance Actions
envbox-2.1.0.tar.gz 9.6 kB Without provenance Details for envbox-2.1.0.tar.gz

Built distribution (wheel)

Table of built distributions (wheels) for envbox 2.1.0
File Interpreter ABI Platform Actions
envbox-2.1.0-py3-none-any.whl Python 3 none any Details for envbox-2.1.0-py3-none-any.whl

Total release size: 21.7 kB

Release files / envbox-2.1.0.tar.gz

Download URL envbox-2.1.0.tar.gz
Size 9.6 kB
Tags Source
SHA-256 checksum
How to use checksums
f82569925685d500f57efef106f6d9245401ec66bf5c12240f23891fd28f537d
BLAKE2b-256 checksum
How to use checksums
cde4071c44d951be968675ed421df46af0f5da44f00d8ea616c13fb72e154d26
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via uv/0.13.7 {"installer":{"name":"uv","version":"0.13.7","subcommand":["publish"]},"python":null,"implementation":{"name":null,"version":null},"distro":{"name":"Ubuntu","version":"26.04","id":"resolute","libc":null},"system":{"name":null,"release":null},"cpu":null,"openssl_version":null,"setuptools_version":null,"rustc_version":null,"ci":null}

Release files / envbox-2.1.0-py3-none-any.whl

Download URL envbox-2.1.0-py3-none-any.whl
Size 12.1 kB
Tags Python 3
SHA-256 checksum
How to use checksums
230778593e999938f3a1204d9a551159d4a557ee3ebea365dd2e767ce5705b09
BLAKE2b-256 checksum
How to use checksums
b8f1eec38c33dfd79d43087bcb7dd9e8f13796ad381d92e68754d9d540eb7647
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via uv/0.13.7 {"installer":{"name":"uv","version":"0.13.7","subcommand":["publish"]},"python":null,"implementation":{"name":null,"version":null},"distro":{"name":"Ubuntu","version":"26.04","id":"resolute","libc":null},"system":{"name":null,"release":null},"cpu":null,"openssl_version":null,"setuptools_version":null,"rustc_version":null,"ci":null}

Security for envbox 2.1.0

Provenance

Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.

No provenance found

None of the files in this release were uploaded with provenance metadata.

A note on package security

PyPI is a repository for distributing packages, not a service for auditing them. While third-party security researchers and our staff do their best to detect and remove malicious packages, PyPI cannot guarantee the quality, security or suitability of any given package.

To learn more about protecting yourself from malicious actors, visit our package security documentation.

Anthropic, PBC Visionary sponsor Bloomberg Visionary sponsor Hudson River Trading Visionary sponsor Meta Visionary sponsor NVIDIA Visionary sponsor Microsoft Sustainability sponsor Depot Continuous Integration AWS Cloud computing and Security Sponsor Datadog Monitoring Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page