Validatedata 0.3.0 – lightweight inline data validation for Python
Pydantic alternative for scripts and CLIs, but overlaps with existing inline validation approaches.

Inline validation without schema classes, but Pydantic already owns this space.
Python developers building scripts, CLIs, and lightweight APIs who need validation but find Pydantic overkill.
Pydantic · Marshmallow · voluptuous
It's a lightweight Python library for inline data validation—think quick checks on dicts, lists, function args, or API payloads without defining full schema classes like in Pydantic.
Why revive it? I kept running into cases where Pydantic (or Marshmallow) felt like overkill for scripts, CLIs, simple backends, or one-off data cleaning. I wanted something expressive but minimal: inline rules, decorators, no boilerplate models, built-in checks (email/url/phone/regex/range/length/unique/nullable/transforms/conditionals/nested), and clean error output.
Core ways to use it:
1. Standalone on data: ```python from validatedata import validate_data
data = {"username": "alice", "email": "[email protected]", "age": 25} rules = {"keys": { "username": {"type": "str", "range": (3, 32)}, "email": {"type": "email"}, "age": {"type": "int", "range": (18, "any")} }}
result = validate_data(data, rules) if result.ok: print("Valid!") else: print(result.errors) # e.g. ["age: must be at least 18"]
Features include:
Shorthand rules like 'email', 'int:18:to:99', 'phone' Conditional (depends_on), transforms (strip/upper), mutation for cleaned data Nested fields/items, strict/no-coercion mode Powered by dateutil for flexible date parsing (ISO, natural-ish formats) MIT licensed, pytest on PRs, Python >=3.7, only optional dep (phonenumbers for phone)
Install: pip install validatedata Repo: https://github.com/Edward-K1/validatedata PyPI: https://pypi.org/project/validatedata/ Happy to hear feedback, bug reports, feature ideas, or use-case stories—especially if this saves anyone time on lightweight validation. Does this fill a gap for you, or am I missing something obvious? Thanks!
Pydantic alternative for scripts and CLIs, but overlaps with existing inline validation approaches.
Rule-based function dispatching beats functools.singledispatch for complex validation logic.
Pydantic alternative for when defining full model classes feels like overkill.
Implicit parallelism from function signatures beats manual asyncio.gather spaghetti.
Map any Python function to 1000 VMs in <1 second, automatic env sync.
NumPy's full API in JavaScript with zero dependencies, 93% coverage validated against Python.