Skip to content
This repository

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP

Environment Variables for Humans™

branch: master

Merge pull request #3 from snh/maplowercase

Modified map to lower case input keys.
latest commit 85be6b1a78
Kenneth Reitz authored August 19, 2012
Octocat-spinner-32 .travis.yml
Octocat-spinner-32 LICENSE lawyer up May 08, 2012
Octocat-spinner-32 Makefile
Octocat-spinner-32 README.rst env August 20, 2012
Octocat-spinner-32 env.py
Octocat-spinner-32 setup.py clean import May 08, 2012
Octocat-spinner-32 tests.py test stuff August 20, 2012
README.rst

Env: Environment Variables for Humans

https://secure.travis-ci.org/kennethreitz/env.png?branch=master

Mapping environment variables can be a bit of a pain.

Now you can replace this boilerplate:

ZENDESK_URL = os.environ['ZENDESK_URL']
ZENDESK_USER = os.environ['ZENDESK_USER']
ZENDESK_PASS = os.environ['ZENDESK_PASS']
ZENDESK_VIEW = os.environ['ZENDESK_VIEW']

With a simple call:

import env
>>> zendesk = env.prefix('zendesk_')
>>> zendesk
{'user': ..., 'pass': ..., 'url': ..., 'view': ...}

Or have a bit more control:

>>> env.map(user='zendesk_user')
{'user': ...}

Installation

Installation is easy with pip:

$ pip install env
Something went wrong with that request. Please try again.