Skip to main content

A simple local environmental variable manager

Project description

Local Environment Variables

This package allows you to specify which environmental variable you require in your application. It will create a .env file, prompt you to populate it, and add the .env file to your .gitignore file.

The functionality described is in line with the guidelines set out in the The Twelve-Factor App section III Config.

Implementation

from local_env_vars.env import LocalEnvVars

env = EnvironmentManager("sql_server_address", "sql_username", "sql_password")

connection_string = "Driver={{SQL Server}};Server={0}; Database=AdventureWorks;uid={1};pwd={2}".format(
        env.vars['sql_server_address'], env.vars['sql_username'], env.vars['sql_password']
    )

Running this code for the first time will create a .env file with the following content. It will throw an exception reporting that you must provide values to the keys.

{"sql_server_address": "", "sql_username": "", "sql_password": ""}

After you have populated the keys with values you will be able to execute the code without any exceptions.

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

local-env-vars-0.0.3.tar.gz (3.7 kB view details)

Uploaded Source

Built Distribution

local_env_vars-0.0.3-py3-none-any.whl (4.1 kB view details)

Uploaded Python 3

File details

Details for the file local-env-vars-0.0.3.tar.gz.

File metadata

  • Download URL: local-env-vars-0.0.3.tar.gz
  • Upload date:
  • Size: 3.7 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/3.4.2 importlib_metadata/4.6.3 pkginfo/1.7.1 requests/2.25.0 requests-toolbelt/0.9.1 tqdm/4.62.0 CPython/3.8.1

File hashes

Hashes for local-env-vars-0.0.3.tar.gz
Algorithm Hash digest
SHA256 a953bc4eaa44758be80b870ea6ddddd3fd9e3c209dbd4b7f9ff6dc253ef062b8
MD5 0dac631d22b337e1bbcca8c8715ac461
BLAKE2b-256 5b6a3523cf699f6a1a90db460718ef598960281ea480bb405adb4b2ce5d97ae5

See more details on using hashes here.

File details

Details for the file local_env_vars-0.0.3-py3-none-any.whl.

File metadata

  • Download URL: local_env_vars-0.0.3-py3-none-any.whl
  • Upload date:
  • Size: 4.1 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/3.4.2 importlib_metadata/4.6.3 pkginfo/1.7.1 requests/2.25.0 requests-toolbelt/0.9.1 tqdm/4.62.0 CPython/3.8.1

File hashes

Hashes for local_env_vars-0.0.3-py3-none-any.whl
Algorithm Hash digest
SHA256 61ebd993839bb516ed9da085d837d639e2182ec66c08a17dfffc2efb4c1ad6da
MD5 dcf8b58cd0c483d03b11326087f0bac9
BLAKE2b-256 8cdbef37a4c28dbbb8b6f7494d7d555feaa402f0020571292be86ecfe32535da

See more details on using hashes here.

Supported by

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