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.

Features

  • Compatible with both Python 2 and 3

  • No dependencies aside from Python’s core os and builtins/__builtin__ modules

  • Fully tested

  • BSD (3-Clause) licensed

TODO

  • Type-annotated

  • Thoroughly documented

Examples

>>> from parsenvy import parsenvy
>>> parsenvy.bool('BOOL_ENV_VAR')  # BOOL_ENV_VAR=True
True
>>> parsenvy.int('INT_ENV_VAR')  # INT_ENV_VAR=13
13
>>> parsenvy.float('FLOAT_ENV_VAR')  # FLOAT_ENV_VAR=555.55
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
'meep'
>>> parsenvy.set('SET_ENV_VAR')  # SET_ENV_VAR=wat,wut,wot
set(['wat', 'wut', 'wot'])
>>> parsenvy.dict('DICT_ENV_VAR')  # DICT_ENV_VAR=a:1,b:2
{'a': '1', 'b': '2'}

Install

pip install parsenvy

Contributing

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.

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-0.1.2.tar.gz (2.3 kB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

parsenvy-0.1.2-py2-none-any.whl (2.8 kB view details)

Uploaded Python 2

File details

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

File metadata

  • Download URL: parsenvy-0.1.2.tar.gz
  • Upload date:
  • Size: 2.3 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No

File hashes

Hashes for parsenvy-0.1.2.tar.gz
Algorithm Hash digest
SHA256 d7749e868379bf3676dcbe98e1bb661a5b5d24d4e7b722b768f0b1692188db66
MD5 fd33053b6120223dc82d0a21d23a2c2e
BLAKE2b-256 a6d14e1b7a9b03b86bdef9b6c3aea40dbd9b6acb41ee74ff43b95f9435cb6efb

See more details on using hashes here.

File details

Details for the file parsenvy-0.1.2-py2-none-any.whl.

File metadata

File hashes

Hashes for parsenvy-0.1.2-py2-none-any.whl
Algorithm Hash digest
SHA256 824e321d275dd544e080a007888067bff97ff46074f6f574954d838e76bf242f
MD5 3e0ea28b39053dbca44571c383cbc59b
BLAKE2b-256 fc067306e9d9af138d7a20c2ca89e153a1cb1b5f486d37f9884a198a0e7f74da

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