Typed environment variable parsing for Python
Project description
typenv
Version 0.1.1
Typed environment variable parsing for Python
Background
Typenv does environment variable parsing with an API almost identical to the excellent environs. There are a few reasons why typenv might be preferred:
- Type annotated typecast functions: type checkers are able to understand types of parsed environment variables.
- More flexible prefix manipulation of environment variable names.
- Validation of environment variable names.
- Optional automatic uppercasing of environment variable names.
- Ability to generate a .env.example that shows expected types of environment variables.
- Less dependencies. No marshmallow required.
Installing
Installing from PyPI repository (https://pypi-hypernode.com/project/typenv):
pip install typenv
Usage
See environs README.md for now, as the API of typenv is mostly just a subset of environs'.
The types supported by typenv are:
env.str
env.int
env.bool
env.float
env.decimal
env.json
env.list
- Takes a subcast argument for casting list items to one of
str
,int
,bool
,float
ordecimal.Decimal
- Takes a subcast argument for casting list items to one of
TODO: Add a more comprehensive API documentation / usage guide here.
Acknowledgments
The public API of this library is almost an exact copy of environs, which is based on envparse and django-environ. Credit for the interface goes to the authors of those libraries.
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
File details
Details for the file typenv-0.1.1.tar.gz
.
File metadata
- Download URL: typenv-0.1.1.tar.gz
- Upload date:
- Size: 6.2 kB
- Tags: Source
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/3.1.1 pkginfo/1.5.0.1 requests/2.23.0 setuptools/40.8.0 requests-toolbelt/0.9.1 tqdm/4.45.0 CPython/3.8.0
File hashes
Algorithm | Hash digest | |
---|---|---|
SHA256 | ad9fa7741b5ff2917d2ea3c42ad7447c2d79ff07838cce53534896a69b4c2447 |
|
MD5 | 754be22877e7d0e0041c34dee22e793c |
|
BLAKE2b-256 | ac45d428d4ee780376759fed4fb43b7359cdb453c4e1f82a0ef5dbc5232d09e7 |