snapcfg
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.
Features
- ✅ 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
Installation
pip install snapcfg
Or from source:
git clone https://github.com/yourname/snapcfg.git
cd snapcfg
pip install .
Usage
CLI
snapcfg validate --config path/to/config.yaml --schema path/to/schema.yaml
Python API
from 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)
Example
config.yaml
port: 8080
debug: true
schema.yaml
port:
type: int
min: 1
max: 65535
required: true
debug:
type: bool
default: false
License
This project is licensed under the terms of the MPL-2.0 license.
Metadata
Release files for snapcfg 0.1.1
For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.
Source distribution (sdist)
| File | Size | Uploaded | Provenance | |
|---|---|---|---|---|
| snapcfg-0.1.1.tar.gz | 9.3 kB | With provenance | Details |
Built distribution (wheel)
| File | Interpreter | ABI | Platform | Reset |
|---|---|---|---|---|
| snapcfg-0.1.1-py3-none-any.whl | Python 3 | none | any | Details |
Total release size: 19.3 kB
Release files / snapcfg-0.1.1.tar.gz
| Download URL | snapcfg-0.1.1.tar.gz |
|---|---|
| Size | 9.3 kB |
| Tags | Source |
|
SHA-256 checksum How to use checksums |
99dad2d404ac12c8954b76f9cc001c2dbbd1accd1bfc4998b0198061ecb0a4b0
|
|
BLAKE2b-256 checksum How to use checksums |
ac4c8f67a2320aa5cb63e96d3d6b8e7161a7d8bf72bf7bdf5cd1a17772493696
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
Yes |
| Uploaded via |
twine/6.1.0 CPython/3.12.9
|
Provenance
Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.
PyPI Publish Attestation
PyPI verified that this artifact, at this checksum, originated from the publisher listed below.
Signed by GitHub Actions, verified by PyPI on Apr 24, 2025.
Transparency logRelease files / snapcfg-0.1.1-py3-none-any.whl
| Download URL | snapcfg-0.1.1-py3-none-any.whl |
|---|---|
| Size | 10.0 kB |
| Tags | Python 3 |
|
SHA-256 checksum How to use checksums |
b58635b29898385a591813eeef55091741edc47ea761b3e9f0bc75b8a9733ef0
|
|
BLAKE2b-256 checksum How to use checksums |
9b89a7bc58d59e0e1cee195dfb017c5fdc548724e45338181d2e693f1f550bee
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
Yes |
| Uploaded via |
twine/6.1.0 CPython/3.12.9
|
Provenance
Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.
PyPI Publish Attestation
PyPI verified that this artifact, at this checksum, originated from the publisher listed below.
Signed by GitHub Actions, verified by PyPI on Apr 24, 2025.
Transparency logSecurity for snapcfg 0.1.1
Provenance
Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.
Full provenance
All 2 files in this release have been uploaded with provenance metadata.
Attestation for snapcfg-0.1.1.tar.gz
PyPI Publish Attestation
PyPI verified that this artifact, at this checksum, originated from the publisher listed below.
Signed by GitHub Actions, verified by PyPI on Apr 24, 2025.
Transparency logA note on package security
PyPI is a repository for distributing packages, not a service for auditing them. While third-party security researchers and our staff do their best to detect and remove malicious packages, PyPI cannot guarantee the quality, security or suitability of any given package.