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
>>> 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
Release history Release notifications | RSS feed
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
Built Distribution
Filter files by name, interpreter, ABI, and platform.
If you're not sure about the file name format, learn more about wheel file names.
Copy a direct link to the current filters
File details
Details for the file parsenvy-1.0.0.tar.gz.
File metadata
- Download URL: parsenvy-1.0.0.tar.gz
- Upload date:
- Size: 2.4 kB
- Tags: Source
- Uploaded using Trusted Publishing? No
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
f75b0c79b4017de3dd5547f8c4dbfcc5ad84ed87b8908d46c0e11a7b54720d82
|
|
| MD5 |
ffb267516ddb38098d4f0bba03b8361a
|
|
| BLAKE2b-256 |
96e9d7d6ac3ae79fa74ba3977d70d9192810d204148530b447b6001f37c2158f
|
File details
Details for the file parsenvy-1.0.0-py2-none-any.whl.
File metadata
- Download URL: parsenvy-1.0.0-py2-none-any.whl
- Upload date:
- Size: 2.8 kB
- Tags: Python 2
- Uploaded using Trusted Publishing? No
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
c2f5d1bcb4699a3b235db9b1516530a1e8a0db57ab1af7eceb3c5f5019e6c2e4
|
|
| MD5 |
580b8b01522b49ea5c21b5b4cb7374ca
|
|
| BLAKE2b-256 |
b01407e9aa2695a062110c9dd453b6b98a8abab267a3d7eb4c118c8c4c1adf0a
|