Skip to main content

Enviously elegant environment variable parsing

Project description

Parsenvy is an enviously elegant environment variable parsing Python library.

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.!-1EAEDB.svg


  • Compatible with Python 3.6+ only (the last Python 2 compatible version was 1.0.2)
  • Fully tested on Linux and Windows
  • No dependencies aside from Python’s core builtins, os, and typing modules
  • BSD (3-Clause) licensed


>>> import parsenvy
>>> parsenvy.bool('BOOL_ENV_VAR')  # BOOL_ENV_VAR=True
>>> parsenvy.float('FLOAT_ENV_VAR')  # FLOAT_ENV_VAR=555.55
>>> parsenvy.list('LIST_ENV_VAR')  # LIST_ENV_VAR=shiver,me,timbers
['shiver', 'me', 'timbers']
>>> parsenvy.tuple('TUPLE_ENV_VAR')  # TUPLE_ENV_VAR=hello,world
('hello', 'world')
>>> parsenvy.str('STR_ENV_VAR')  # STR_ENV_VAR=meep
>>> parsenvy.set('SET_ENV_VAR')  # SET_ENV_VAR=wat,wut,wot
set(['wat', 'wut', 'wot'])

# Note: Version 3 will deprecate parsenvy.dict().
>>> parsenvy.dict('DICT_ENV_VAR')  # DICT_ENV_VAR=a:1,b:2
{'a': '1', 'b': '2'}


pip install parsenvy


Contributions of all sorts are welcome, be they bug reports, patches, or even just feedback. Creating a new issue or pull request is probably the best way to get started.

Please note that this project is released with a Contributor Code of Conduct. By participating in this project you agree to abide by its terms.

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 2.1.0
Filename, size File type Python version Upload date Hashes
Filename, size Parsenvy-2.1.0-py3-none-any.whl (4.3 kB) File type Wheel Python version py3 Upload date Hashes View
Filename, size Parsenvy-2.1.0.tar.gz (3.0 kB) File type Source Python version None Upload date Hashes View

Supported by

Pingdom Pingdom Monitoring Google Google Object Storage and Download Analytics Sentry Sentry Error logging AWS AWS Cloud computing DataDog DataDog Monitoring Fastly Fastly CDN DigiCert DigiCert EV certificate StatusPage StatusPage Status page