Skip to main content

Super Simple Processing of Environmental Variables

Project description

simple-env

Simple Processing of Environmental Variables

features

  • automatic removal of quotes (" and ')
  • automatic conversion of Booleans ("true", "True", and "TRUE" are converted into True)
  • automatic conversion of Integers
  • automatic suggestion of typo corrections

usage

get variable

import simple_env as se

email_host = se.get("EMAIL_HOST")
# email_host is "smtp.gmail.com"

email_use_tls = se.get("EMAIL_USE_TLS")
# email_use_tls is True

email_port = se.get("EMAIL_PORT")
# email_port is 8080

suppress warnings

By default, simple env warns when it can't find a variable and offers an alternative suggestion if possible.

email_use_tls = se.get("USE_TLS")

prints

[simple-env] could not find "USE_TLS", did you mean "EMAIL_USE_TLS"?

check if environmental variable is set

import simple_env as se

hasState = se.has("STATE")
# hasState is True if the variable is set to null

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

simple-env-0.2.2.tar.gz (2.9 kB view details)

Uploaded Source

File details

Details for the file simple-env-0.2.2.tar.gz.

File metadata

  • Download URL: simple-env-0.2.2.tar.gz
  • Upload date:
  • Size: 2.9 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/3.2.0 pkginfo/1.5.0.1 requests/2.24.0 setuptools/47.3.1 requests-toolbelt/0.9.1 tqdm/4.46.1 CPython/3.7.3

File hashes

Hashes for simple-env-0.2.2.tar.gz
Algorithm Hash digest
SHA256 4b7e8c70098db42692a13bc25c53c22c5f7647b46a5211b506fa51135657b805
MD5 052f88896239f881a8f06b8593525f81
BLAKE2b-256 4b161125c1eafc9a07ee6fe7c7b82080af1af65f63209abf456d9b42af798c2c

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