Our great sponsors
-
Having run into these issues with Pydantic, we've been using Mashumaro[1], which, while not having all the bells and whistles of Pydantic, has served us pretty well.
-
datamodel-code-generator
Pydantic model generator for easy conversion of JSON, OpenAPI, JSON Schema, and YAML data sources.
had generally good experience creating typed wrappers for api's with json-schema-to-pydantic[0] converter
-
SonarQube
Static code analysis for 29 languages.. Your projects are multi-language. So is SonarQube analysis. Find Bugs, Vulnerabilities, Security Hotspots, and Code Smells so you can release quality code every time. Get started analyzing your projects today for free.
-
Mypy allows that because initial versions of PEP-484 allowed that. This has changed; here's the current wording on the PEP:
> This is no longer the recommended behavior. Type checkers should move towards requiring the optional type to be made explicit.
-
>I didn't know about the performance differences. Sam Colvin strikes me as very thorough and the community is very involved, so I don't think the benchmarks claiming pydantic faster than attrs is wrong. I know pydantic uses cython under the hood (no idea what) - is it possible that environmental differences are causing the discrepancy?
If I'm reading this issue right the benchamrks in the pydantic docs are misleading https://github.com/samuelcolvin/pydantic/pull/1568
Also
-
```
Cattrs has some problems with generics [1] [2]. Dacite and marshmallow-dataclasses don't support generics well either, with some issues around Union types.
They do work well for simple python types but what I'd like to see is guarantee that the serialisation operation is completely reversible and if not raise warning/exception.
Related posts
- Azure Functions and FastAPI
- msgspec - a fast & friendly JSON/MessagePack library
- apischema v0.17 - I've developed the fastest typed JSON (de)serialization library, and you can also build your GraphQL schema with it
- The Pocket Guide To API Request Validation You Wish You Had Earlier
- Project Althaia - looking for performance/accuracy feedback on my shallow fork of marshmallow