Skip to main content

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

  1. Install the package (if not already installed):
pip install -r requirements.txt
  1. Run the CLI tool to validate the .env file:
    envguard --required DATABASE_URL --required SECRET_KEY
  1. If the .env file is correct, you’ll see:
    All required environment variables are present!
  1. 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
  1. You’ll see an error like this:
    Missing or incorrect environment variables:
    - SECRET_KEY

Project details


Release history Release notifications | RSS feed

This version

0.1

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)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

envguard-0.1-py3-none-any.whl (3.1 kB view details)

Uploaded Python 3

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

Hashes for envguard-0.1.tar.gz
Algorithm Hash digest
SHA256 0013534405f0735fe324a0206fefeb5ee0626e8cbce1c667da6d70f3c59a28c2
MD5 8f09b7a0b4c0b14901487b536be7a734
BLAKE2b-256 2ebc7207a95fca779c9d739c35727cddd794de3c4f4373a0518b3588a24e59f6

See more details on using hashes here.

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

Hashes for envguard-0.1-py3-none-any.whl
Algorithm Hash digest
SHA256 2b6848a8e1eaa5756a5b9b28e77970f870d6343a44c8a9487f5586d2986dea4b
MD5 d6d0e7b81b3b827d6b4bba6d65d80971
BLAKE2b-256 a753f06e916dc66ee7c90c29047883511591cf6546ac102f7c656b625383b5f3

See more details on using hashes here.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Pingdom Monitoring Sentry Error logging StatusPage Status page