Pyenv Validator
This package validates .env variables. You can configure validation rules by
adding the appropriate comments to the .env.example file.
Installation
Install the package in the desired environment:
pip install pyenv-validator
Add the package to your requirements.txt file:
pyenv_validator~=0.2.0
In your pipeline, add:
from pyenv_validator import PyenvValidator
PyenvValidator.check()
Updating
Simply run:
pip install pyenv-validator --update
Configuring env variable
In your .env.example file, you can add comments to tell PyenvValidator how to validate the variable:
MY_REQUIRED_VAR=value #required
THIS_IS_AN_OPTIONAL_INT=123 #format=int
THIS_IS_A_REQUIRED_EMAIL=123 #required,format=email
Formats
strorstringorString(accepts anything)email(checks value against/[\w@]+@[\w@]+\.[\w@]+/)url(checks value against/https?:\/\/.+/)boolorbooleanorBoolean(checks value againsttrueorfalse, case sensitive)uuidorUUID(checks value against/\A[\da-f]{32}\z/ior/\A[\da-f]{8}-([\da-f]{4}-){3}[\da-f]{12}\z/i)
Metadata
Release files for pyenv-validator 0.2.0
For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.
Source distribution (sdist)
| File | Size | Uploaded | |
|---|---|---|---|
| pyenv_validator-0.2.0.tar.gz | 3.8 kB | Details |
Built distribution (wheel)
| File | Interpreter | ABI | Platform | Reset |
|---|---|---|---|---|
| pyenv_validator-0.2.0-py3-none-any.whl | Python 3 | none | any | Details |
Total release size: 7.5 kB
Release files / pyenv_validator-0.2.0.tar.gz
| Download URL | pyenv_validator-0.2.0.tar.gz |
|---|---|
| Size | 3.8 kB |
| Tags | Source |
|
SHA-256 checksum How to use checksums |
c727e217a85cbd6aa3aac4f6421dd2dcb6e0a94af48ed253eb9b393512818007
|
|
BLAKE2b-256 checksum How to use checksums |
c27093b1aa56a3750517f43942106b7ac8bcf19e0117850b0afd2164da51c889
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
twine/4.0.2 CPython/3.11.3
|
Release files / pyenv_validator-0.2.0-py3-none-any.whl
| Download URL | pyenv_validator-0.2.0-py3-none-any.whl |
|---|---|
| Size | 3.7 kB |
| Tags | Python 3 |
|
SHA-256 checksum How to use checksums |
730d7251209a77e38defc63ab1a5410e38a17f0da417bf480de540fce47863fd
|
|
BLAKE2b-256 checksum How to use checksums |
f111c20a73d9aedfab81f0469df3abce5f8107553101e43fbb377044a44eab30
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
twine/4.0.2 CPython/3.11.3
|