Python Validation

Open-source Python projects categorized as Validation | Edit details

Top 23 Python Validation Projects

  • pydantic

    Data parsing and validation using Python type hints

    Project mention: Flask vs FastAPI? | reddit.com/r/Python | 2022-05-06

    Yea everything is built from inspect up.Pydantic takes that and builds a class out of it. There are some strange side effects from that process that are non obvious especially when paired with how fastapi does their dependency injection creates some non obvious items. These items are very hard to modify.

  • marshmallow

    A lightweight library for converting complex objects to and from simple Python datatypes.

    Project mention: The Pocket Guide To API Request Validation You Wish You Had Earlier | dev.to | 2022-01-06

    Marshmallow

  • Scout APM

    Less time debugging, more time building. Scout APM allows you to find and fix performance issues with no hassle. Now with error monitoring and external services monitoring, Scout is a developer's best friend when it comes to application development.

  • jsonschema

    An implementation of the JSON Schema specification for Python

    Project mention: I wrote okjson - A fast, simple, and pythonic JSON Schema Validator | reddit.com/r/Python | 2022-03-31

    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.

  • Schematics

    Python Data Structures for Humans™.

  • pandera

    A light-weight, flexible, and expressive data validation library for dataframes

    Project mention: Data validation for dashboards | reddit.com/r/dataengineering | 2022-04-22

    In my opinion for simple data validation tasks the best solution is always Pandera.

  • WTForms

    A flexible forms validation and rendering library for Python.

    Project mention: Using HTML5 fields with WTForms | reddit.com/r/codehunter | 2022-03-15

    I then ended up on the WTForms github page, and found that actually there is support for all the new HTML5 fields, but that these fields aren't imported by default. https://github.com/wtforms/wtforms/blob/master/wtforms/fields/html5.py Therefore instead of using

  • webargs

    A friendly library for parsing HTTP request arguments, with built-in support for popular web frameworks, including Flask, Django, Bottle, Tornado, Pyramid, webapp2, Falcon, and aiohttp.

  • SonarLint

    Deliver Cleaner and Safer Code - Right in Your IDE of Choice!. SonarLint is a free and open source IDE extension that identifies and catches bugs and vulnerabilities as you code, directly in the IDE. Install from your favorite IDE marketplace today.

  • strictyaml

    Type-safe YAML parser and validator.

    Project mention: YAML: The Missing Battery in Python | reddit.com/r/Python | 2022-04-06

    For manually-maintained data, I'm inclined to stick within the syntax limits of StrictYAML. It keeps me from getting too fancy.

  • enforce

    Python 3.5+ runtime type checking for integration testing and data validation

    Project mention: Python’s “Type Hints” are a bit of a disappointment to me | news.ycombinator.com | 2022-04-21

    Every point in this blog post strikes me as either (1) unaware of the tooling around python typing other than mypy, or (2) a criticism of static-typing-bolted-on-to-a-dynamically-typed-language, rather than Python's hints. Regarding (1), my advise to OP is to try out Pyright, Pydantic, and Typeguard. Pyright, especailly, is amazing and makes the process of working with type hints 2 or 3 times smoother IMO. And, I don't think points that fall under (2) are fair criticisms of type *hints*. They are called hints for a reason.

    Otherwise, here's a point-by-point response, either recommending OP checks out tooling, or showing that the point being made is not specific to Python.

    > type hints are not binding.

    There are projects [0][1] that allow you to enforce type hints at runtime if you so choose.

    It's worth mentioning that this is very analogous to how Typescript does it, in that type info is erased completely at runtime.

    > Type checking is your job after all, ...[and that] requires maintenance.

    There are LSPs like Pyright[2] (pyright specifically is the absolute best, IMO) that report type errors as you code. Again, this is very very similar to typescript.

    > There is an Any type and it renders everything useless

    I have never seen a static-typing tool that was bolted on to a dynamically typed language, without an `Any` type, including typescript.

    > Duck type compatibility of int and float

    The author admits that they cannot state why this behavior is problematic, except for saying that it's "ambiguous".

    > Most projects need third-party type hints

    Again, this is a criticism of all cases where static types are bolted on dynamically typed languages, not Python's implementation specifically.

    > Sadly, dataclasses ignore type hints as well

    Pydantic[3] is an amazing data parsing library that takes advantage of type hints, and it's interface is a superset of that of dataclasses. What's more, it underpins FastAPI[4], an amazing API-backend framework (with 44K Github stars).

    > Type inference and lazy programmers

    The argument of this section boils down to using `Any` as a generic argument not being an error by default. This is configurable to be an error both in Pyright[5], and mypy[6].

    > Exceptions are not covered [like Java]

    I can't find the interview/presentation, but Guido Van Rossum specifically calls out Java's implementation of "exception annotations" as a demonstration of why that is a bad idea, and that it would never happen in Python. I'm not saying Guido's opinion is the absolute truth, but just letting you know that this is an explicit decision, not an unwanted shortcoming.

    [0] https://github.com/RussBaz/enforce

    [1] https://github.com/agronholm/typeguard

    [2] https://github.com/microsoft/pyright

    [3] https://pydantic-docs.helpmanual.io

    [4] https://github.com/tiangolo/fastapi

    [5] https://github.com/microsoft/pyright/blob/main/docs/configur...

    [6] https://mypy.readthedocs.io/en/stable/config_file.html#confv...

  • colander

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

  • Deal

    Design by contract for Python. Write bug-free code. Add a few decorators, get static analysis and tests for free.

    Project mention: deal: Design by contract for Python. Write bug-free code. Add a few decorators, get static analysis and tests for free. | reddit.com/r/opensource | 2022-05-01
  • openapi-spec-validator

    OpenAPI Spec validator

    Project mention: Validating RESTful-ness of Flask API | reddit.com/r/devops | 2021-08-17

    I did find https://github.com/p1c2u/openapi-spec-validator and https://github.com/p1c2u/openapi-schema-validator, but I'm pretty new to the devops world so I'm not sure if these are exactly what I'm looking for. Any recommendations or advice is appreciated.

  • flask-pydantic

    flask extension for integration with the awesome pydantic package

    Project mention: How do professional SWEs keep learning more Python? | reddit.com/r/Python | 2022-01-06
  • aiohttp-apispec

    Build and document REST APIs with aiohttp and apispec

    Project mention: Flask vs FastAPI? | reddit.com/r/Python | 2022-05-06

    Here https://github.com/maximdanilchenko/aiohttp-apispec

  • apischema

    JSON (de)serialization, GraphQL and JSON schema generation using Python typing.

    Project mention: apischema v0.17 - I've developed the fastest typed JSON (de)serialization library, and you can also build your GraphQL schema with it | reddit.com/r/Python | 2022-01-18

    Take a look at the documentation: https://wyfo.github.io/apischema/ (I've put so much of my sleeping hours in it 😅)

  • msgspec

    A fast and friendly JSON/MessagePack library, with optional schema validation

    Project mention: Faster, more memory-efficient Python JSON parsing with msgspec | reddit.com/r/Python | 2022-05-13

    - https://github.com/jcrist/msgspec

  • awesome-pattern-matching

    Pattern Matching for Python 3.7+ in a simple, yet powerful, extensible manner.

  • pydantic-to-typescript

    CLI Tool for converting pydantic models into typescript definitions

    Project mention: pydantic-to-typescript: a simple CLI tool for converting pydantic models into typescript interfaces | reddit.com/r/Python | 2022-01-29

    Complete documentation, examples, and the source code can all be viewed here: https://github.com/phillipdupuis/pydantic-to-typescript

  • gjf

    A tool to fix invalid GeoJSON objects

    Project mention: gjf: A tool to fix invalid GeoJSON objects | reddit.com/r/Python | 2021-06-20
  • blockchain-certificates

    Used to create, issue, revoke, or validate certificates (or any other PDF file) on the public Bitcoin blockchain.

    Project mention: Your guide to Block.co’s platform | reddit.com/r/BlockchainStartups | 2021-06-04

    ✔️GitHub

  • openapi-schema-validator

    OpenAPI schema validator for Python

    Project mention: Validating RESTful-ness of Flask API | reddit.com/r/devops | 2021-08-17

    I did find https://github.com/p1c2u/openapi-spec-validator and https://github.com/p1c2u/openapi-schema-validator, but I'm pretty new to the devops world so I'm not sure if these are exactly what I'm looking for. Any recommendations or advice is appreciated.

  • drf-typed

    Type hints for enhanced API views and serializers.

    Project mention: New package: Django REST - Typed | reddit.com/r/django | 2022-01-10

    Github repo/docs: https://github.com/rsinger86/drf-typed

  • Maat

    Validation and transformation library powered by deductive ascending parser. Made to be extended for any kind of project.

    Project mention: Pydantic | news.ycombinator.com | 2022-01-22
NOTE: The open source projects on this list are ordered by number of github stars. The number of mentions indicates repo mentiontions in the last 12 Months or since we started tracking (Dec 2020). The latest post mention was on 2022-05-13.

Python Validation related posts

Index

What are some of the best open-source Validation projects in Python? This list will help you:

Project Stars
1 pydantic 9,877
2 marshmallow 6,076
3 jsonschema 3,659
4 Schematics 2,487
5 pandera 1,344
6 WTForms 1,306
7 webargs 1,259
8 strictyaml 1,029
9 enforce 531
10 colander 415
11 Deal 391
12 openapi-spec-validator 214
13 flask-pydantic 199
14 aiohttp-apispec 192
15 apischema 117
16 msgspec 104
17 awesome-pattern-matching 92
18 pydantic-to-typescript 89
19 gjf 87
20 blockchain-certificates 58
21 openapi-schema-validator 36
22 drf-typed 32
23 Maat 27
Find remote jobs at our new job board 99remotejobs.com. There are 13 new remote jobs listed recently.
Are you hiring? Post a new remote job listing for free.
SaaSHub - Software Alternatives and Reviews
SaaSHub helps you find the best software and product alternatives
www.saashub.com