Skip to main content

A modern Python data validation library

Project description

⚖️ Probatio

GitHub Release Python Versions Project Stage Project Maintenance License

Build Status CodSpeed OpenSSF Scorecard

Put your data to the proof.

About

Probatio is a modern, maintained data validation library for Python. The model is simple: a schema is data, and data describes data. You compose schemas from plain Python types, dicts, lists, and a handful of small helpers, then call the schema with a value to validate it.

It is a drop-in for voluptuous: the same public API, so you can swap the import and keep your existing schemas. Probatio is a clean-room reimplementation (the same API written fresh, not a fork), which means it can be actively maintained, ships under a clean MIT license, and is free to fix bugs and improve its internals without inheriting old decisions. See ADR-001 for the full reasoning, and Credits and inspiration for the lineage.

It does not stop at parity. Probatio clears voluptuous's own backlog (cross-field rules, dataclass and TypedDict schemas, network and format validators, errors that carry a path and suggest the key you meant), and it is held to the bar you would want from a library that loads untrusted config. See Why trust it.

Probatio is pure Python: no compiler, no build step, no native extension. Install it and import it. Requires Python 3.13 or newer.

Installation

pip install probatio

Or with uv:

uv add probatio

Usage

Define a schema, then call it with a value to validate it. A valid value comes back (possibly normalized); an invalid one raises Invalid.

from probatio import Schema, Required, Optional

schema = Schema(
    {
        Required("name"): str,
        Optional("port", default=8080): int,
    }
)

schema({"name": "app"})
# {'name': 'app', 'port': 8080}

When a value does not match, the error carries a path to the offending value:

from probatio import Schema, Invalid

schema = Schema({"port": int})

try:
    schema({"port": "nope"})
except Invalid as err:
    print(err)
    # expected int for dictionary value @ data['port']

Why trust it

It is a config-loading library, so the real question is whether you would feed it untrusted input. The evidence, not the adjectives:

  • voluptuous 0.16.0 test suite: 140 pass, 27 deliberate and documented deviations. voluptuous's own authors' notion of the contract, run against Probatio.
  • Home Assistant config_validation: 142 of 142 pass, with voluptuous swapped out for Probatio.
  • 100% line and branch coverage, type-checked under both mypy and ty, in CI.
  • Fuzzed on every untrusted-input surface. The first fuzzing pass found hundreds of exception leaks on hostile input. All fixed; none since.
  • Safer than the original: a built-in validator only ever raises Invalid, never a raw exception, and that is enforced, not hoped for.

Migrating from voluptuous

Probatio aims to be a drop-in replacement. In most cases the migration is a single import change:

# Before
from voluptuous import Schema, Required, Optional, All, Any, Coerce, Invalid

# After
from probatio import Schema, Required, Optional, All, Any, Coerce, Invalid

The markers (Required, Optional, Remove, Extra), combinators (All, Any), helpers (Coerce, Range, In, Length, Match, and friends), and errors (Invalid, MultipleInvalid) all behave the way they do in voluptuous. See the migration guide for the current compatibility status.

Documentation

Full documentation lives at probatio.frenck.dev: getting started, the migration guide, and the API reference.

Changelog & Releases

This repository keeps a change log using GitHub's releases functionality. The format of the log is based on Keep a Changelog. There is intentionally no CHANGELOG.md file: the GitHub Releases are the changelog.

Releases are based on Semantic Versioning, and use the format of MAJOR.MINOR.PATCH. In a nutshell, the version will be incremented based on the following:

  • MAJOR: Incompatible or major changes.
  • MINOR: Backwards-compatible new features and enhancements.
  • PATCH: Backwards-compatible bugfixes and package updates.

Contributing

This is an active open-source project. We are always open to people who want to use the code or contribute to it.

Using AI tools to help is fine, but you must review and understand everything you submit. Please read our AI Policy first; autonomous agents are not allowed, and unreviewed AI output will be closed.

Before you start, read the contributing guide, the code of conduct, and the security policy. Bugs and feature requests go to the issue tracker.

Thank you for being involved! :heart_eyes:

Credits and inspiration

Probatio owes its design to voluptuous by Alec Thomas. The API and the "schema is data" validation model are its inspiration. Probatio reimplements them fresh, no code copied, so the result can be maintained and MIT licensed, but the original idea is theirs and the credit belongs to them.

voluptuous itself drew on earlier work, and it is only fair to pass that on: Validino as its major influence, with lighter nods to jsonvalidator and json_schema. Probatio stands on that same lineage.

Authors & contributors

The original setup of this repository is by Franck Nijhof.

For a full list of all authors and contributors, check the contributor's page.

License

MIT License

Copyright (c) 2026 Franck Nijhof

Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions:

The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software.

THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.

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

probatio-0.1.0.tar.gz (194.8 kB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

probatio-0.1.0-py3-none-any.whl (127.2 kB view details)

Uploaded Python 3

File details

Details for the file probatio-0.1.0.tar.gz.

File metadata

  • Download URL: probatio-0.1.0.tar.gz
  • Upload date:
  • Size: 194.8 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? Yes
  • Uploaded via: twine/6.1.0 CPython/3.13.13

File hashes

Hashes for probatio-0.1.0.tar.gz
Algorithm Hash digest
SHA256 2d67df2f4d17899a5c81d8d5142c293be60d9f4a940fe5a3db1083ae146248da
MD5 2d49a26585c340b237bc6fbd3b97ed96
BLAKE2b-256 0499d2aa7330b8bc780fa2c40a8e4229d0fd0f3d91bf0fbe152bd00943cab8e7

See more details on using hashes here.

Provenance

The following attestation bundles were made for probatio-0.1.0.tar.gz:

Publisher: release.yaml on frenck/probatio

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

File details

Details for the file probatio-0.1.0-py3-none-any.whl.

File metadata

  • Download URL: probatio-0.1.0-py3-none-any.whl
  • Upload date:
  • Size: 127.2 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? Yes
  • Uploaded via: twine/6.1.0 CPython/3.13.13

File hashes

Hashes for probatio-0.1.0-py3-none-any.whl
Algorithm Hash digest
SHA256 bbeccbe3600bff607d5be1dc285d251a8e8066294b2291d00836e932128d8fa4
MD5 87e0063ff79805c34ca46854ec607903
BLAKE2b-256 c3f7dfcb4eb75fb0c9f3326974437f43ff42694d4c7e5ec0048ba0169f5922ef

See more details on using hashes here.

Provenance

The following attestation bundles were made for probatio-0.1.0-py3-none-any.whl:

Publisher: release.yaml on frenck/probatio

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

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