env-file 2019.1.29
pip install env-file==2019.1.29
Newer version available (2020.12.3)
Released:
.env file handler. required for django, docker, etc
Navigation
Unverified details
These details have not been verified by PyPIProject links
Meta
- License: Public Domain
- Tags env
Classifiers
- License
- Operating System
- Programming Language
- Topic
Project description
Install
$ [sudo] pip install env-file
Classes
env_file.EnvFile
- .env file class
Functions
function | __doc__ |
---|---|
env_file.get(variable, default=None) |
return the value for variable if variable is in the file, else default |
env_file.load(path='.env') |
load .env file variables and return a dictionary |
env_file.setup(path='.env') |
load .env file variables and set environment variables |
env_file.update(**kwargs) |
update .env file |
CLI
usage | __doc__ |
---|---|
python -m env_file variable [value] |
get/set .env variable |
usage: env-file variable [value]
Examples
Django example
.env
DJANGO_SETTINGS_MODULE = project.settings
DJANGO_SECRETKEY = somerandomkey
DB_NAME=dbname
DB_PASS=secret
manage.py
import env_file
import sys
if __name__ == "__main__":
# os.environ.setdefault("DJANGO_SETTINGS_MODULE", "project.settings")
env_file.setup()
from django.core.management import execute_from_command_line
execute_from_command_line(sys.argv)
library example
>>> import env_file
>>> env_file.get('DB_NAME')
'DB_NAME'
>>> env_file.load(['.env','dev.env'])
cli example
$ env-file DB_NAME
dbname
readme-md - README.md generator
Project details
Unverified details
These details have not been verified by PyPIProject links
Meta
- License: Public Domain
- Tags env
Classifiers
- License
- Operating System
- Programming Language
- Topic
Release history Release notifications | RSS feed
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
Built Distribution
File details
Details for the file env-file-2019.1.29.tar.gz
.
File metadata
- Download URL: env-file-2019.1.29.tar.gz
- Upload date:
- Size: 2.7 kB
- Tags: Source
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/1.12.1 pkginfo/1.4.2 requests/2.21.0 setuptools/40.6.3 requests-toolbelt/0.8.0 tqdm/4.28.1 CPython/3.7.2
File hashes
Algorithm | Hash digest | |
---|---|---|
SHA256 |
fb206cf4c1943949aebfc5271c4b9c13e453a4dff306b456bab6c63931dd7ade
|
|
MD5 |
25ac7408a9e26801b4071e80ba86a37b
|
|
BLAKE2b-256 |
c625d2cfe1dda671e1bbf3315c7c7779cd12299cb8d72ff001944c54eaa36975
|
File details
Details for the file env_file-2019.1.29-py2.py3-none-any.whl
.
File metadata
- Download URL: env_file-2019.1.29-py2.py3-none-any.whl
- Upload date:
- Size: 3.5 kB
- Tags: Python 2, Python 3
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/1.12.1 pkginfo/1.4.2 requests/2.21.0 setuptools/40.6.3 requests-toolbelt/0.8.0 tqdm/4.28.1 CPython/3.7.2
File hashes
Algorithm | Hash digest | |
---|---|---|
SHA256 |
00222f2a92c36a75a8375d924ecc799d8bd377f7441fc4bd1772f61f68c585fc
|
|
MD5 |
fd775d70975bfa5ba6420b216d5735ff
|
|
BLAKE2b-256 |
6382d7e23d0b0a9a99d053bb9cd4de5565205e135ce04502b7698fe4c50110ca
|