Comparison
attrs vs dataclasses
Maintenance, adoption and momentum side by side, from PyPI, GitHub and deps.dev data refreshed every day.
Classes Without Boilerplate
Maintained. Last release 8 months ago, commits in 18 of the last 26 weeks. Weaker on release cadence and contributor spread.
$
pip install attrsA backport of the dataclasses module for Python 3.6
Likely abandoned. No release or commit for years (last release over 6 years ago). It brings a standard-library module to older Pythons: on current versions, use the built-in one.
$
pip install dataclassesIn short
- dataclasses looks abandoned: avoid it for new projects.
- attrs is the most used: 932.4M downloads a month, 143× more than dataclasses.
- attrs also has the best Pythie’s Index (62).
- attrs is growing fastest: downloads +14% over the last month.
- Safe default for a new project: attrs.
Side by side
| Metric | attrs | dataclasses |
|---|---|---|
| Pythie’s Index | Pythie’s Index: 62 | 11 |