A tool to check for missing or incorrect environment variables in .env files.
Project description
EnvGuard
EnvGuard is a Python tool to check for missing or incorrect environment variables in .env files.
Features
- Validate required environment variables.
- Command-line interface for easy usage.
Installation
pip install -r requirements.txt
Usage
envguard --required DATABASE_URL --required SECRET_KEY
Example .env File
DATABASE_URL=postgres://user:password@localhost:5432/mydb
SECRET_KEY=mysecretkey
License
MIT
Example .env File
Create a .env file in the root of your project with the following content:
DATABASE_URL=postgres://user:password@localhost:5432/mydb
SECRET_KEY=mysecretkey
Testing Steps
- Install the package (if not already installed):
pip install -r requirements.txt
- Run the CLI tool to validate the .env file:
envguard --required DATABASE_URL --required SECRET_KEY
- If the .env file is correct, you’ll see:
All required environment variables are present!
- To test missing variables, edit the .env file and remove one of the variables (e.g., SECRET_KEY). Then run the command again:
envguard --required DATABASE_URL --required SECRET_KEY
- You’ll see an error like this:
Missing or incorrect environment variables:
- SECRET_KEY
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
envguard-0.1.tar.gz
(2.8 kB
view details)
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 envguard-0.1.tar.gz.
File metadata
- Download URL: envguard-0.1.tar.gz
- Upload date:
- Size: 2.8 kB
- Tags: Source
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/6.1.0 CPython/3.12.3
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
0013534405f0735fe324a0206fefeb5ee0626e8cbce1c667da6d70f3c59a28c2
|
|
| MD5 |
8f09b7a0b4c0b14901487b536be7a734
|
|
| BLAKE2b-256 |
2ebc7207a95fca779c9d739c35727cddd794de3c4f4373a0518b3588a24e59f6
|
File details
Details for the file envguard-0.1-py3-none-any.whl.
File metadata
- Download URL: envguard-0.1-py3-none-any.whl
- Upload date:
- Size: 3.1 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/6.1.0 CPython/3.12.3
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
2b6848a8e1eaa5756a5b9b28e77970f870d6343a44c8a9487f5586d2986dea4b
|
|
| MD5 |
d6d0e7b81b3b827d6b4bba6d65d80971
|
|
| BLAKE2b-256 |
a753f06e916dc66ee7c90c29047883511591cf6546ac102f7c656b625383b5f3
|