# attrs

> Python classes without boilerplate

Source: https://talira.ai/catalog/attrs-gctqvn64
Every listing: https://talira.ai/catalog.md

- Kind: Open source
- Types: Library
- Categories: [developer tools / code generation](https://talira.ai/categories/developer-tools/code-generation), [libraries / value equality](https://talira.ai/categories/libraries/value-equality), [languages / python](https://talira.ai/categories/languages/python)
- Licence: MIT[^1]
- Pricing: Free and open source[^1]
- Free tier: yes[^1]
- Backed by: [Hynek Schlawack](https://talira.ai/orgs/hynek-schlawack.md)

attrs is a Python library that writes the boring parts of classes for you: you declare a class's attributes with a decorator, and it generates the initializer, a readable repr, equality and ordering methods and more, without a runtime performance cost. Type annotations are optional. Python's own dataclasses descend from it, and attrs does more: custom equality for things like NumPy arrays, hooks into initialization, and generated methods you can step through in a debugger. Hynek Schlawack and its contributors maintain it.

## Links

- Website: https://www.attrs.org/
- GitHub: https://github.com/python-attrs/attrs
- Docs: https://www.attrs.org/en/stable/

## Problems it solves

- stop writing __init__, __repr__ and __eq__ by hand for every Python class
- define Python data classes with validation and more control than dataclasses
- compare objects holding NumPy arrays correctly in an equality check

## Features

- generated __init__, __repr__ and equality methods
- ordering and hashing on request
- type annotations optional
- custom equality, for example for NumPy arrays
- hooks into initialization
- no runtime performance penalty

## Trust

Overall: 0.61 out of 1.
Signals: maintenance 0.77, adoption 0.75, momentum 0.49, community 0.92, backing 0.30, extensibility 0.00.

- last commit 3 days ago
- 26 commits in the last 90 days
- latest release 26.1.0 8 months ago
- 5.9k GitHub stars
- 196 contributors
- accepts sponsorship (Github, Tidelift, Thanks Dev)
- backed by Hynek Schlawack

## Alternatives

- [Pydantic](https://talira.ai/catalog/pydantic-5as3qf1q.md): Data validation using Python type hints

## Sources

[^1]: https://github.com/python-attrs/attrs/blob/main/README.md (checked 28 Nov 2026)
