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.

Files for parsenvy, version 3.0.2
Filename, size File type Python version Upload date Hashes
Filename, size Parsenvy-3.0.2.tar.gz (34.7 kB) File type Source Python version None Upload date Hashes View
Filename, size Parsenvy-3.0.2-py3-none-any.whl (42.1 kB) File type Wheel Python version py3 Upload date Hashes View

Supported by

AWS AWS Cloud computing Datadog Datadog Monitoring Facebook / Instagram Facebook / Instagram PSF Sponsor Fastly Fastly CDN Google Google Object Storage and Download Analytics Huawei Huawei PSF Sponsor Microsoft Microsoft PSF Sponsor NVIDIA NVIDIA PSF Sponsor Pingdom Pingdom Monitoring Salesforce Salesforce PSF Sponsor Sentry Sentry Error logging StatusPage StatusPage Status page