Skip to main content

Detect environment type and work within.

Project description

https://github.com/idlesign/envbox

release lic ci coverage

Description

Detect environment type and work within.

Features

  • Environment type detection (extendable system);

  • Convenient os.environ proxying (with optional values casting into Python natives);

  • Automatic submodule-for-environment import tool;

  • CLI for environment type 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
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': ...}

Read the docs for more examples.

CLI

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

Note: envbox CLI requires click package available.

Documentation

http://envbox.readthedocs.org/

Project details


Download files

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

Source Distribution

envbox-0.2.0.tar.gz (13.5 kB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

envbox-0.2.0-py2.py3-none-any.whl (8.5 kB view details)

Uploaded Python 2Python 3

File details

Details for the file envbox-0.2.0.tar.gz.

File metadata

  • Download URL: envbox-0.2.0.tar.gz
  • Upload date:
  • Size: 13.5 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No

File hashes

Hashes for envbox-0.2.0.tar.gz
Algorithm Hash digest
SHA256 d11d73edb6bb5cfed6b8bc1010e93c728cc6b57b97d7bd4e5af698e4a15f2ca6
MD5 06367b64f03dcd193a4a75fba60b5ed1
BLAKE2b-256 f2c9b2fc8571f1de17fff8b24106a7e286e91528f83615524a4dd92bc1535810

See more details on using hashes here.

File details

Details for the file envbox-0.2.0-py2.py3-none-any.whl.

File metadata

File hashes

Hashes for envbox-0.2.0-py2.py3-none-any.whl
Algorithm Hash digest
SHA256 5c189d1a8412f9b2b8b6dcfcf10e32957df6854427b4f0f195f0f736d3db786e
MD5 547aef2e5c25401114f2355c9721094e
BLAKE2b-256 dc6a9517e1f0b81b7b924bb58454f5f07f56c53f09db8012b5a54d29ab1706cd

See more details on using hashes here.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Pingdom Monitoring Sentry Error logging StatusPage Status page