Skip to main content

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


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

localenv-0.0.2.tar.gz (8.8 kB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

localenv-0.0.2-py3-none-any.whl (8.0 kB view details)

Uploaded Python 3

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

Hashes for localenv-0.0.2.tar.gz
Algorithm Hash digest
SHA256 38e4f013af9a42e3c1be7e0e4c902781230712782b46d0b78e7a4841b59069ee
MD5 095e63ea4339f37edcfcab65de922c1d
BLAKE2b-256 c5b502f99697823454e183e4427ee5b50d3dbfb63fc77ceddbdf97cabba02449

See more details on using hashes here.

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

Hashes for localenv-0.0.2-py3-none-any.whl
Algorithm Hash digest
SHA256 18f3f91d798bd749182da2a92abd0048ca316edad82ec50894e7420ab336574c
MD5 453823d949fd61071b952d18de3f853f
BLAKE2b-256 96bf1ebcbbf6c531cc087275de6314370a42b0310fc7084d01fe1bf2f1df7082

See more details on using hashes here.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Pingdom Monitoring Sentry Error logging StatusPage Status page