snapcfg is a minimal configuration validation tool for Python projects. It allows you to load JSON or YAML configuration files and validate them against a simple, JSON-like schema with type checks and constraints.
Uses snaparg!
- ✅ Supports JSON and YAML config files
- 🧾 Simple schema format using Python dicts
- 🛠 CLI and Python API for validation
- 🧪 Validates types (
int,str,bool), ranges, required fields, and defaults
pip install snapcfgOr from source:
git clone https://github.com/yourname/snapcfg.git
cd snapcfg
pip install .snapcfg validate --config path/to/config.yaml --schema path/to/schema.yamlfrom snapcfg.loader import load_file
from snapcfg.schema_parser import normalize_schema
from snapcfg.validator import validate_config
config = load_file("config.yaml")
schema = normalize_schema(load_file("schema.yaml"))
validated = validate_config(config, schema)config.yaml
port: 8080
debug: trueschema.yaml
port:
type: int
min: 1
max: 65535
required: true
debug:
type: bool
default: falseThis project is licensed under the terms of the MPL-2.0 license.