jsonschema VS Cerberus

Compare jsonschema vs Cerberus and see what are their differences.

jsonschema

An implementation of the JSON Schema specification for Python (by python-jsonschema)

Cerberus

Lightweight, extensible data validation library for Python (by pyeve)
Our great sponsors
  • WorkOS - The modern identity platform for B2B SaaS
  • InfluxDB - Power Real-Time Data Analytics at Scale
  • SaaSHub - Software Alternatives and Reviews
jsonschema Cerberus
4 3
4,431 3,106
1.2% 0.5%
8.8 7.4
8 days ago 6 months ago
Python Python
MIT License ISC License
The number of mentions indicates the total number of mentions that we've tracked plus the number of user suggested alternatives.
Stars - the number of stars that a project has on GitHub. Growth - month over month growth in stars.
Activity is a relative number indicating how actively a project is being developed. Recent commits have higher weight than older ones.
For example, an activity of 9.0 indicates that a project is amongst the top 10% of the most actively developed projects that we are tracking.

jsonschema

Posts with mentions or reviews of jsonschema. We have used some of these posts to build our list of alternatives and similar projects. The last one was on 2022-07-07.
  • Forced to move away from Django template because of nested forms ?
    2 projects | /r/django | 7 Jul 2022
    Forms are hard. We use python jsonschema to write our form schemas and validation and use react json schema form for the front end. It's a long time in the making and we still have to write widgets and extensions to get everything we need. Good luck.
  • I wrote okjson - A fast, simple, and pythonic JSON Schema Validator
    8 projects | /r/Python | 31 Mar 2022
    I had a requirement to process and validate large payloads of JSON concurrently for a web service, initially I implemented it using jsonschema and fastjsonschema but I found the whole JSON Schema Specification to be confusing at times and on top of that wanted better performance. Albeit there are ways to compile/cache the schema, I wanted to move away from the schema specification so I wrote a validation library inspired by the design of tiangolo/sqlmodel (type hints) to solve this problem easier.
  • Validating a YAML file
    1 project | /r/learnpython | 21 Oct 2021
    This is a hard problem, because, if I understand you correctly, you issue is that you are using something like this: https://github.com/Julian/jsonschema, but want to make the error messages more specific. That means you will need to understand the package sufficiently to find out where it is encountering issues and then provide a more human readable error. Definitely doable, but the first piece, understanding the package enough to revise the messages is difficult.
  • Simple method for JSON body minimum required keys checking
    1 project | /r/flask | 1 Aug 2021

Cerberus

Posts with mentions or reviews of Cerberus. We have used some of these posts to build our list of alternatives and similar projects. The last one was on 2023-09-29.
  • Show HN: Config-file-validator – CLI tool to validate all your config files
    3 projects | news.ycombinator.com | 29 Sep 2023
    I was expecting this to validate the configuration files are also valid for their use cases, not just valid JSON, TOML, etc.

    If you're looking for that and Python is your jam, the library cerberus[0] is very good at it.

    [0]: https://github.com/pyeve/cerberus

  • Do you think we need an open-source web scraping monitoring tool?
    2 projects | /r/webscraping | 6 May 2023
    I wrote scrapy-test as a proof of concept for validating live pages for scrapy spiders if you're looking for some reference but if you're not using scrapy I'd recommend just adding validation tests using data validation tools like cerberus which is super underrated. I cover popular data validation techniques on this short blog I wrote if you want to learn more.
  • Can you suggest something more to grow in scraping?
    2 projects | /r/webscraping | 10 Jun 2022
    Other than that, have you looked into testing scrapers? Since scrapers are working with highly dynamic data writing good tests is quite a challange. For example, for parser monitoring using cerberus is a very cool tool which allows you to define loose requirements like "phone number should always be 9 numbers" etc.

What are some alternatives?

When comparing jsonschema and Cerberus you can also consider the following projects:

schema - Schema validation just got Pythonic

pydantic - Data validation using Python type hints

voluptuous - CONTRIBUTIONS ONLY: Voluptuous, despite the name, is a Python data validation library.

Schematics - Python Data Structures for Humans™.

colander - A serialization/deserialization/validation library for strings, mappings and lists.

pandera - A light-weight, flexible, and expressive statistical data testing library

valideer - Lightweight data validation and adaptation Python library.