I use attrs instead of pydantic

This page summarizes the projects mentioned and recommended in the original post on news.ycombinator.com

InfluxDB – Built for High-Performance Time Series Workloads
InfluxDB 3 OSS is now GA. Transform, enrich, and act on time series data directly in the database. Automate critical tasks and eliminate the need to move data externally. Download now.
www.influxdata.com
featured
SaaSHub - Software Alternatives and Reviews
SaaSHub helps you find the best software and product alternatives
www.saashub.com
featured
  1. mashumaro

    Fast and well tested serialization library

    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.

    1: https://github.com/Fatal1ty/mashumaro

  2. InfluxDB

    InfluxDB – Built for High-Performance Time Series Workloads. InfluxDB 3 OSS is now GA. Transform, enrich, and act on time series data directly in the database. Automate critical tasks and eliminate the need to move data externally. Download now.

    InfluxDB logo
  3. datamodel-code-generator

    Pydantic model and dataclasses.dataclass 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

    [0] https://github.com/koxudaxi/datamodel-code-generator

  4. typing

    Python static typing home. Hosts the documentation and a user help forum.

    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.

    https://www.python.org/dev/peps/pep-0484/#id29

  5. pydantic

    Data validation using Python type hints

    >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

  6. cattrs

    Composable custom class converters for attrs, dataclasses and friends.

    ```

    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.

    [1] https://github.com/Tinche/cattrs/issues/149

  7. SaaSHub

    SaaSHub - Software Alternatives and Reviews. SaaSHub helps you find the best software and product alternatives

    SaaSHub logo
NOTE: The number of mentions on this list indicates mentions on common posts plus user suggested alternatives. Hence, a higher number means a more popular project.

Suggest a related project

Related posts

  • Show HN: Mutuple – Replace items in Python's "immutable" tuples

    2 projects | news.ycombinator.com | 10 Apr 2024
  • Litestar 2.0

    4 projects | /r/Python | 29 Aug 2023
  • Help making draggable items for Flask app.

    1 project | /r/flask | 21 Aug 2023
  • Starlite updates March '22 | 2.0 is coming

    14 projects | /r/Python | 26 Mar 2023
  • How do you manage typing between Django backend and a TypeScript frontend?

    4 projects | /r/django | 16 Jan 2023

Did you know that Python is
the 2nd most popular programming language
based on number of references?