Python library
schemafied
A Python library that checks nested data against a schema and reports every error at once, with the exact path to each one.
What it is
Schemafied validates a dictionary against a schema you describe in code. You declare fields (numbers, strings, lists, nested dictionaries), and it tells you whether the data fits.
I built it at work as internal tooling, then open-sourced it. It has no runtime dependencies and ships with type hints.
Why I built it
Most validators stop at the first problem. If a payload has five things wrong, you fix one, resubmit, and meet the next. Schemafied collects every error in one pass, and each one carries the path to the exact field, like users[0].profile.age.
- 60test cases across 6 test files
- 0runtime dependencies
- ~1,000lines of library code
Use it
from schemafied import Schema, NumberField, StringField
schema = Schema({
"name": StringField(min_length=1, max_length=100),
"age": NumberField(min_value=0, max_value=120),
})
result = schema.validate({"name": "Alice", "age": 28})
Fields can be optional with defaults, can coerce compatible types, and accept your own validator functions. Large lists can cap how many item errors they report, so a bad payload of a thousand rows doesn't produce a thousand messages.
How it's built
The library is small on purpose: a Schema, a base Field, four field types, a validation context that gathers errors as it walks the data, and an exception that holds them all. Each field type owns its own rules, so adding a new one means writing one class.
What I'd change
I'd add JSON Schema export, so a schema defined once can also describe an API. It's the first thing I'd build next.
Need someone who owns a feature from the first call to the last deploy?
I'm open to senior software, full-stack and forward deployed roles, in India or abroad. A 15-minute call is the quickest way to see if we fit.