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.9+ 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.3.tar.gz (42.6 kB view details)

Uploaded Source

Built Distribution

parsenvy-3.0.3-py3-none-any.whl (5.3 kB view details)

Uploaded Python 3

File details

Details for the file parsenvy-3.0.3.tar.gz.

File metadata

  • Download URL: parsenvy-3.0.3.tar.gz
  • Upload date:
  • Size: 42.6 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: uv/0.5.24

File hashes

Hashes for parsenvy-3.0.3.tar.gz
Algorithm Hash digest
SHA256 931c15a8d718f3a0e4cb0e0ca11fad4338c472a6faae69a86ee36ef9e253ce5d
MD5 c4822ae4104af3c6ba37e116d369ad6c
BLAKE2b-256 139295a162096d6ac809f17312ef52dd0a6121bc5c3611feb9a9cbb69293be58

See more details on using hashes here.

File details

Details for the file parsenvy-3.0.3-py3-none-any.whl.

File metadata

  • Download URL: parsenvy-3.0.3-py3-none-any.whl
  • Upload date:
  • Size: 5.3 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: uv/0.5.24

File hashes

Hashes for parsenvy-3.0.3-py3-none-any.whl
Algorithm Hash digest
SHA256 9f1160045aece8e2caa26039dc7e3adce534374777fa4741e708a9cc0d5387f2
MD5 d35a0b4a95a003bd1fa66c960eff85a9
BLAKE2b-256 a83648f625a4e3dc88341a98791a6020d5ddf94451d4d2823b19637cf6d502e5

See more details on using hashes here.

Supported by

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