I use attrs instead of pydantic

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

Scout Monitoring - Free Django app performance insights with Scout Monitoring
Get Scout setup in minutes, and let us sweat the small stuff. A couple lines in settings.py is all you need to start monitoring your apps. Sign up for our free tier today.
www.scoutapm.com
featured
InfluxDB - Power Real-Time Data Analytics at Scale
Get real-time insights from all types of time series data with InfluxDB. Ingest, query, and analyze billions of data points in real-time with unbounded cardinality.
www.influxdata.com
featured
  • 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

  • Scout Monitoring

    Free Django app performance insights with Scout Monitoring. Get Scout setup in minutes, and let us sweat the small stuff. A couple lines in settings.py is all you need to start monitoring your apps. Sign up for our free tier today.

    Scout Monitoring logo
  • 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

  • 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

  • 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

  • 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

  • InfluxDB

    Power Real-Time Data Analytics at Scale. Get real-time insights from all types of time series data with InfluxDB. Ingest, query, and analyze billions of data points in real-time with unbounded cardinality.

    InfluxDB 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 konow that Python is
the 1st most popular programming language
based on number of metions?