Skip to main content

Enviously elegant environment variable parsing

Project description

Parsenvy is an enviously elegant environment variable parsing Python library.

main Documentation Status Github Actions badgefury svg Unreleased chages License: BSD-3-Clause

Environment variables are strings by default. This can be rather inconvenient if you’re dealing with a number of them, and in a variety of desired types. Parsenvy aims to provide an intuitive, explicit interface for retrieving these values in appropriate types with human-friendly syntax.

Features

  • Compatible with Python 3.6+ only (the last Python 2 compatible version was 1.0.2).

  • Fully tested on Linux, macOS, and Windows.

  • No dependencies outside of the Python standard library.

  • BSD (3-Clause) licensed.

  • Utterly awesome.

  • Now with docs!

Examples

>>> import parsenvy

>>> parsenvy.bool('DEBUG_ENABLED')  # DEBUG_ENABLED=True
True

>>> parsenvy.int('POSTS_PER_PAGE')  # POSTS_PER_PAGE=13
13

>>> parsenvy.float('EXCHANGE_RATE')  # EXCHANGE_RATE=42.911
42.911

>>> parsenvy.list('INVALID_USERNAMES')  # INVALID_USERNAMES=admin,superuser,user,webmaster
['admin', 'superuser', 'user', 'webmaster']

>>> parsenvy.tuple('SAMPLE_GREETING')  # SAMPLE_GREETING=Hello,world!
('Hello', 'world!')

>>> parsenvy.set('ALLOWED_CATEGORIES')  # ALLOWED_CATEGORIES=python,vim,git
{'python', 'vim', 'git'}

>>> parsenvy.str('DB_PREFIX')  # DB_PREFIX=dj_
'dj_'

Install

pip install parsenvy

Contributing

Contributions are welcome, and more information is available in the contributing guide.

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

Parsenvy-3.0.2.tar.gz (34.7 kB view details)

Uploaded Source

Built Distribution

Parsenvy-3.0.2-py3-none-any.whl (42.1 kB view details)

Uploaded Python 3

File details

Details for the file Parsenvy-3.0.2.tar.gz.

File metadata

  • Download URL: Parsenvy-3.0.2.tar.gz
  • Upload date:
  • Size: 34.7 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: poetry/1.1.4 CPython/3.9.1 Linux/5.4.0-1039-azure

File hashes

Hashes for Parsenvy-3.0.2.tar.gz
Algorithm Hash digest
SHA256 51e3e87a75450f187f85f834778cb660eb20930fe7a90f946e7058619e68623d
MD5 e8ad34f52954980393be5da2e8b62612
BLAKE2b-256 c7b0ed228be653462eedbabb9f1a6b5e522ae28ac1ed0fd87607aa8bb8f71d4a

See more details on using hashes here.

File details

Details for the file Parsenvy-3.0.2-py3-none-any.whl.

File metadata

  • Download URL: Parsenvy-3.0.2-py3-none-any.whl
  • Upload date:
  • Size: 42.1 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: poetry/1.1.4 CPython/3.9.1 Linux/5.4.0-1039-azure

File hashes

Hashes for Parsenvy-3.0.2-py3-none-any.whl
Algorithm Hash digest
SHA256 cb7eac1d82784dc6483a273666d42605bdb840190eeb0cb120c78ff21b31f686
MD5 d590ceba45e175fa52ea773cfd0cba04
BLAKE2b-256 98b4e81f2a9daa874c9b0a2b1969a2335ed985eeb5087acc0dfe758781b00584

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