Skip to main content

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

Project description

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-0.1.6.tar.gz (4.7 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-0.1.6-py3-none-any.whl (5.8 kB view details)

Uploaded Python 3

File details

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

File metadata

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

File hashes

Hashes for envguard_validator-0.1.6.tar.gz
Algorithm Hash digest
SHA256 e4f084e698cf3da0ca8f59c9999b05a72de73de0c3f1636794b3f30d4d62d6f4
MD5 52feb751c7c1689abcbcccb0ef5028c4
BLAKE2b-256 07a59ff6c90df9782f5bda4e9f9dcf763b50b03ffd7430dd331d52b27203a480

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for envguard_validator-0.1.6-py3-none-any.whl
Algorithm Hash digest
SHA256 20b542cce9e29e6c056ce12d2ba321b9f87fec70f61d9136ea51e3d77f282621
MD5 8244de87eb0443c3a7efa661c1665afd
BLAKE2b-256 ccd23cceea3adf4f71fe9f46b1a2edfa945378b1b6c0b949a36f3a5fa0a7194c

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