Detect environment type and work within.
Project description
https://github.com/idlesign/envbox
Description
Detect environment type and work within.
Features
Environment type detection (extendable system);
Convenient os.environ proxying (with optional values casting into Python natives);
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': ...}
CLI
$ envbox probe
# >> Detected environment type: development (Development)
Note: envbox CLI requires click package available.
Documentation
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.1.0.tar.gz
(12.5 kB
view hashes)
Built Distribution
Close
Hashes for envbox-0.1.0-py2.py3-none-any.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | cb37540dad1f0cfa98acc2428e45e6127416e4a858e062658891d0f12fa3dc36 |
|
MD5 | 8799a3445612a450141a267581e80384 |
|
BLAKE2b-256 | ea182384d8cc559ab7c291cdfe155f1b7c0c486b9bac51c995c591f805d71835 |