Attrs – The One Python Library Everyone Needs

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

SaaSHub - Software Alternatives and Reviews
SaaSHub helps you find the best software and product alternatives
www.saashub.com
featured
  • pydantic

    Data validation using Python type hints

    Pydantic is dataclasses, except types are validated at runtime? It's nice and looks just like a normal dataclass looking at https://pydantic-docs.helpmanual.io/

    For any larger program, pervasive type annotations and "compile" time checking with mypy is a really good idea though, which somewhat lessens the need for runtime checking.

  • SaaSHub

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

    SaaSHub logo
  • dataclasses

    dataclasses was explicitly inspired by attrs. https://github.com/ericvsmith/dataclasses/issues/1

  • CPython

    The Python programming language

    This is only remotely relevant but I recently learned that the related `dataclasses` id implemented by constructing _string representations_ of functions and calling `exec` on them.

    https://github.com/python/cpython/blob/3.10/Lib/dataclasses....

    Kind of blew my mind

  • traits

    Observable typed attributes for Python classes (by enthought)

    My favourite among this class of Python libraries has been traits from Enthought:

    https://github.com/enthought/traits

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

  • Checkbox Extraction from PDFs - A Tutorial

    3 projects | dev.to | 16 Jul 2024
  • Advanced RAG with guided generation

    2 projects | dev.to | 18 Apr 2024
  • Pydantic v2 ruined the elegance of Pydantic v1

    1 project | news.ycombinator.com | 28 Jan 2024
  • Ask HN: Pydantic has too much deprecation. Why is it popular?

    1 project | news.ycombinator.com | 3 Jan 2024
  • OpenAI uses Pydantic for their ChatCompletions API

    1 project | news.ycombinator.com | 3 Dec 2023