Skip to main content

Python wrapper for EnvGuard — validate .env files against a YAML schema

Project description

EnvGuard

envguard-validator (Python)

Python wrapper for EnvGuard — validate .env files against a declarative YAML schema.

Install

pip install envguard-validator

The correct EnvGuard binary for your platform is downloaded automatically on first use.

Quick Start

from envguard import validate

result = validate(schema_path="envguard.yaml", env_path=".env")

if not result.valid:
    for error in result.errors:
        print(f"{error.key}: {error.message}")
    exit(1)

print("✓ Environment validated!")

CLI

envguard-py validate --schema envguard.yaml --env .env

API

validate(schema_path=None, env_path=None, strict=False)ValidationResult

Validates a .env file against a schema.

Returns:

  • ValidationResult.validbool
  • ValidationResult.errorslist[ValidationError]
  • ValidationResult.warningslist[ValidationError]

Each ValidationError has:

  • key — variable name
  • message — human-readable error
  • rule — rule that failed (required, type, pattern, enum, strict)

License

MIT

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

envguard_validator-2.1.0.tar.gz (6.0 kB view details)

Uploaded Source

Built Distribution

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

envguard_validator-2.1.0-py3-none-any.whl (6.0 kB view details)

Uploaded Python 3

File details

Details for the file envguard_validator-2.1.0.tar.gz.

File metadata

  • Download URL: envguard_validator-2.1.0.tar.gz
  • Upload date:
  • Size: 6.0 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.2.0 CPython/3.11.15

File hashes

Hashes for envguard_validator-2.1.0.tar.gz
Algorithm Hash digest
SHA256 85b2be593a643007287619aa7cda2c2e24969f1970aecf67f8b1a97d2d0e757a
MD5 17fddfe1132f47f130c9d62c470f1db5
BLAKE2b-256 19a18692b2b33f3e1a6b74ae0ddf01d18d81664094fad5b787487b6c0f2712c5

See more details on using hashes here.

File details

Details for the file envguard_validator-2.1.0-py3-none-any.whl.

File metadata

File hashes

Hashes for envguard_validator-2.1.0-py3-none-any.whl
Algorithm Hash digest
SHA256 8ec35bbfc7375305d431295454f4a7275a263ce0caf64f0129d1e73c61e6e2c5
MD5 9c24cf02d858a95274047d611d1e3165
BLAKE2b-256 0dd84ae25dc36e2e36a657b0f7d80f44e17aff33b876f0cdce88fdfc3f2a79dc

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