.env Validator
Validate your .env file locally and within a pipeline
- Check you're not missing items from your .env file or os environment
- Exit immediately if required settings are missing
This script will tell you if you're missing items from your env file, and crucially, what they are.
Tip
Use this package in combination with python-dotenv in your project.
Run
If you have an .env.example present in the root of your repo,
then this will be taken as the list of required environment vars.
Optionally, create a file named required_envs.
Validate env within your app start up
from env_validate import validate_env
# (Optional) use python-dotenv to load your settings
from dotenv import load_dotenv
load_dotenv(verbose=True) # optional
validate_env() # will exit if any missing envs, priting missing values
Validate your env locally
In a new shell:
source .env
export $(grep ^[a-zA-Z] .env | cut -d= -f1)
python
from env_validate import validate_env
validate_env()
Validate env inside a pipeline
In your pipeline:
from env_validate import validate_env
validate_env()
Metadata
Release files for env-validate 0.5
For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.
Source distribution (sdist)
| File | Size | Uploaded | Provenance | Actions |
|---|---|---|---|---|
| env_validate-0.5.tar.gz | 1.8 kB | Without provenance | Details for env_validate-0.5.tar.gz |
Release files / env_validate-0.5.tar.gz
| Download URL | env_validate-0.5.tar.gz |
|---|---|
| Size | 1.8 kB |
| Tags | Source |
|
SHA-256 checksum How to use checksums |
3b1a6e0c0c651fdf02acec0ddce898986ac5af0aa88b352e2f4e78e816206207
|
|
BLAKE2b-256 checksum How to use checksums |
c0f3972068ece38f423b4014d3a72e9e4a0ee7be8d215b68fb04b1f10361213d
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
twine/4.0.2 CPython/3.10.6
|
Security for env-validate 0.5
Provenance
Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.
No provenance found
None of the files in this release were uploaded with provenance metadata.
A note on package security
PyPI is a repository for distributing packages, not a service for auditing them. While third-party security researchers and our staff do their best to detect and remove malicious packages, PyPI cannot guarantee the quality, security or suitability of any given package.
To learn more about protecting yourself from malicious actors, visit our package security documentation.