skip to navigation
skip to content

Not Logged In

envious 0.1

Easy injection of environment variables from .env files.

Latest Version: 0.1.1

If you spend a lot of time switching between multiple Python projects and using several virtual environment, you’ll be familiar with the pain of injecting the right environment variables into your scripts. You can use autoenv, but it doesn’t automatically load the virtual environment for you, so you need to litter the .env file with bash commands. Or you can use a postactivate hook in virtualenvwrapper, but that would mean not having a standardized, default location for all the needed environment variables. And what if you use an IDE like PyCharm, which doesn’t load variables from .env files?

Envious solves the problem by loading configurations from an .env file in the working directory directly from within your Python code, injecting environment variables if they’re not already defined, while keeping those that are already set.

Installation

To install envious, simply type:

$ pip install envious

Usage

To have your project import environment variables from an .env file, first create the file in the root folder of your project:

ENVIRONMENT=development
MONGODB_URL=http://localhost:27017/mydb
REDIS_URL=http://localhost:6379/0

Then add the following to the Python app entry point:

from envious import load_env

load_env()
 
File Type Py Version Uploaded on Size
envious-0.1.macosx-10.9-x86_64.exe (md5) MS Windows installer any 2014-03-20 64KB
envious-0.1.tar.gz (md5) Source 2014-03-20 1KB
  • Downloads (All Versions):
  • 29 downloads in the last day
  • 77 downloads in the last week
  • 332 downloads in the last month