Skip to main content

Lightweight, extensible schema and data validation tool for Python dictionaries.

Project description

Build status Python versions Black code style

Cerberus is a lightweight and extensible data validation library for Python.

>>> v = Validator({'name': {'type': 'string'}})
>>> v.validate({'name': 'john doe'})
True

Features

Cerberus provides type checking and other base functionality out of the box and is designed to be non-blocking and easily and widely extensible, allowing for custom validation. It has no dependencies, but has the potential to become yours.

Versioning & Interpreter support

The Cerberus 1.x versions can be used with Python 2 while version 2.0 and later rely on Python 3 features.

Starting with Cerberus 1.2, it is maintained according to semantic versioning. So, a major release sheds off the old and defines a space for the new, minor releases ship further new features and improvements (you now the drill, new bugs are inevitable too), and micro releases polish a definite amount of features to glory.

We intend to test Cerberus against all CPython interpreters at least until half a year after their end of life and against the most recent PyPy interpreter as a requirement for a release. If you still need to use it with a potential security hole in your setup, it should most probably work with the latest minor version branch from the time when the interpreter was still tested. Subsequent minor versions have good chances as well. In any case, you are advised to run the contributed test suite on your target system.

Funding

Cerberus is an open source, collaboratively funded project. If you run a business and are using Cerberus in a revenue-generating product, it would make business sense to sponsor its development: it ensures the project that your product relies on stays healthy and actively maintained. Individual users are also welcome to make a recurring pledge or a one time donation if Cerberus has helped you in your work or personal projects.

Every single sign-up makes a significant impact towards making Eve possible. To learn more, check out our funding page.

Documentation

Complete documentation is available at http://docs.python-cerberus.org

Installation

Cerberus is on PyPI, so all you need to do is:

$ pip install cerberus

Testing

Just run:

$ python setup.py test

Or you can use tox to run the tests under all supported Python versions. Make sure the required python versions are installed and run:

$ pip install tox  # first time only
$ tox

Contributing

Please see the Contribution Guidelines.

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

Cerberus-1.3.3.tar.gz (63.8 kB view details)

Uploaded Source

Built Distribution

Cerberus-1.3.3-py3-none-any.whl (58.1 kB view details)

Uploaded Python 3

File details

Details for the file Cerberus-1.3.3.tar.gz.

File metadata

  • Download URL: Cerberus-1.3.3.tar.gz
  • Upload date:
  • Size: 63.8 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/3.2.0 pkginfo/1.5.0.1 requests/2.23.0 setuptools/54.2.0 requests-toolbelt/0.9.1 tqdm/4.46.0 CPython/3.8.6

File hashes

Hashes for Cerberus-1.3.3.tar.gz
Algorithm Hash digest
SHA256 eec10585c33044fb7c69650bc5b68018dac0443753337e2b07684ee0f3c83329
MD5 10c3e91a7ac184d35c8f3d0e3fa759af
BLAKE2b-256 685e778be77e8250ea2a3ea85acf7bbfd775c683c3fb00d4f1d45edaab7e79f2

See more details on using hashes here.

File details

Details for the file Cerberus-1.3.3-py3-none-any.whl.

File metadata

  • Download URL: Cerberus-1.3.3-py3-none-any.whl
  • Upload date:
  • Size: 58.1 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/3.2.0 pkginfo/1.5.0.1 requests/2.23.0 setuptools/54.2.0 requests-toolbelt/0.9.1 tqdm/4.46.0 CPython/3.8.6

File hashes

Hashes for Cerberus-1.3.3-py3-none-any.whl
Algorithm Hash digest
SHA256 7aff49bc793e58a88ac14bffc3eca0f67e077881d3c62c621679a621294dd174
MD5 2da817134a0b0c7d41a2aec94f51cbfd
BLAKE2b-256 7f2c4e0755ad65cce6d2c847ce09e5c327c4e10a8db2c90b34aaccf6752b6c60

See more details on using hashes here.

Supported by

AWS AWS Cloud computing and Security Sponsor Datadog Datadog Monitoring Fastly Fastly CDN Google Google Download Analytics Microsoft Microsoft PSF Sponsor Pingdom Pingdom Monitoring Sentry Sentry Error logging StatusPage StatusPage Status page