Provide flexible environment variables
Project description
localenv
This file will become your README and also the index of your documentation.
Developer Guide
If you are new to using nbdev here are some useful pointers to get you
started.
Install localenv in Development mode
# make sure localenv package is installed in development mode
$ pip install -e .
# make changes under nbs/ directory
# ...
# compile to have changes apply to localenv
$ nbdev_prepare
Usage
Installation
Install latest from the GitHub repository:
$ pip install git+https://github.com/fenke/localenv.git
or from conda
$ conda install -c fenke localenv
or from pypi
$ pip install localenv
Documentation
Documentation can be found hosted on this GitHub repository’s pages. Additionally you can find package manager specific guidelines on conda and pypi respectively.
How to use
Create a .env.json file somewhere on the parent path(s) of you current
working directory, populate it with environment variables organized in
‘sections’ like
{
"development": {
"USR_TOKEN": "super-secret-token",
},
"production": {
"USR_TOKEN": "another-super-secret-token",
}
}
Then import it similar to the following code snippet
from localenv.envs import production as getenv
This loads the set of variables from under the sectionkey ‘production’
in the .env.json file and makes them accessible via the getenv
function.
getenv('USR_TOKEN')
Project details
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
Filter files by name, interpreter, ABI, and platform.
If you're not sure about the file name format, learn more about wheel file names.
Copy a direct link to the current filters
File details
Details for the file localenv-0.0.2.tar.gz.
File metadata
- Download URL: localenv-0.0.2.tar.gz
- Upload date:
- Size: 8.8 kB
- Tags: Source
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/6.0.1 CPython/3.11.10
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
38e4f013af9a42e3c1be7e0e4c902781230712782b46d0b78e7a4841b59069ee
|
|
| MD5 |
095e63ea4339f37edcfcab65de922c1d
|
|
| BLAKE2b-256 |
c5b502f99697823454e183e4427ee5b50d3dbfb63fc77ceddbdf97cabba02449
|
File details
Details for the file localenv-0.0.2-py3-none-any.whl.
File metadata
- Download URL: localenv-0.0.2-py3-none-any.whl
- Upload date:
- Size: 8.0 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/6.0.1 CPython/3.11.10
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
18f3f91d798bd749182da2a92abd0048ca316edad82ec50894e7420ab336574c
|
|
| MD5 |
453823d949fd61071b952d18de3f853f
|
|
| BLAKE2b-256 |
96bf1ebcbbf6c531cc087275de6314370a42b0310fc7084d01fe1bf2f1df7082
|