Skip to main content

Detect environment type and work within.

Project description

LBC Python 2

release lic ci coverage


Detect environment type and work within.


  • 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()
# >> development

# >> False

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

# {'UNBUFFERED': '1', 'IOENCODING': 'UTF-8', 'PATH': ...}

Read the docs for more examples.


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

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

Note: envbox CLI requires click package available.

Project details

Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Files for envbox, version 1.2.0
Filename, size File type Python version Upload date Hashes
Filename, size envbox-1.2.0-py2.py3-none-any.whl (10.7 kB) File type Wheel Python version 3.6 Upload date Hashes View
Filename, size envbox-1.2.0.tar.gz (17.3 kB) File type Source Python version None Upload date Hashes View

Supported by

AWS AWS Cloud computing Datadog Datadog Monitoring DigiCert DigiCert EV certificate Facebook / Instagram Facebook / Instagram PSF Sponsor Fastly Fastly CDN Google Google Object Storage and Download Analytics Microsoft Microsoft PSF Sponsor Pingdom Pingdom Monitoring Salesforce Salesforce PSF Sponsor Sentry Sentry Error logging StatusPage StatusPage Status page