$npx skillfedfor your agent

attrs

Classes Without Boilerplate

Worth itPyPI Released Mar 2026924.9M downloads / moMITPure Python

Decision gist · record as of 2026-08-14

pure-Python wheel — attrs-26.1.0-py3-none-any.whl
v26.1.0 · released 2026-03-19 · Python >=3.9

Yes. attrs is a mature, zero-dependency library in the top 100 PyPI packages with no known vulnerabilities, active maintenance, and broad Python version support. It eliminates real boilerplate and is the de facto standard for declarative class definition in Python. Install it if you write classes regularly.AI-flagged interpretation of the facts on this page — verify before relying

Before you install

  • Requires Python 3.9 or later.
  • Low friction: pure Python wheel with no runtime dependencies.
  • Actively maintained with recent releases; supports Python 3.9 through 3.14 and both CPython and PyPy implementations.

License · maintenance · safety

MIT (permissive) — MIT license (permissive): you can use, modify, and distribute attrs freely in commercial and private projects with minimal restrictions.

last release 2026-03-19 (148 days)

0 known vulnerabilities (OSV.dev, 2026-08-14) · 924,894,579 downloads/mo, #28 on PyPI

Verify before relying

from attrs import define, Factory

@define
class Example:
    name: str
    items: list = Factory(list)

obj = Example("test")
print(obj)  # Example(name='test', items=[])
  • Whether the package's performance claims (no runtime penalties) have been benchmarked against dataclasses or manual implementations in recent versions.
  • Specific details on how field transformers and validators interact with the initialization process beyond what the changelog excerpt describes.
Same gist for agents: .md · .json

What it is and what it does

attrs is a class-definition library that uses decorators and type annotations to declare attributes once, then automatically generates __init__, __repr__, __eq__, and other dunder methods. Instead of writing these methods by hand for every class, you annotate attributes and let attrs handle the boilerplate. It supports both modern type-annotation syntax and older field() declarations for projects that don't use types.

The library is widely used in production (including by NASA for Mars missions since 2020) and sits at the foundation of many Python projects. It offers more flexibility than the standard library's dataclasses—custom equality handling for NumPy arrays, multiple ways to hook into initialization, and debugger-friendly generated code. It has no runtime dependencies, installs as a pure Python wheel, and supports current Python versions (3.9+) on both CPython and PyPy.

Use it for

  • Define data models or configuration classes without writing __init__ and __repr__ by hand.
  • Build immutable or frozen classes with automatic equality and hashing.
  • Create classes with factory defaults and custom validators for field values.
  • Migrate from manual class boilerplate to declarative syntax while keeping full control over initialization hooks.
  • Use in scientific or data-heavy projects where NumPy array comparison needs special handling.

Worth the install?

AI-flagged interpretation of the facts on this page. Verify before relying on it.

Worth it

Yes.

attrs is a mature, zero-dependency library in the top 100 PyPI packages with no known vulnerabilities, active maintenance, and broad Python version support. It eliminates real boilerplate and is the de facto standard for declarative class definition in Python. Install it if you write classes regularly.

Install

attrs on PyPI

Before you install

Low friction: pure Python wheel with no runtime dependencies. Actively maintained with recent releases; supports Python 3.9 through 3.14 and both CPython and PyPy implementations.

Requires Python 3.9 or later.

License in practice

MIT license (permissive): you can use, modify, and distribute attrs freely in commercial and private projects with minimal restrictions.

Quickstart

from attrs import define, Factory

@define
class Example:
    name: str
    items: list = Factory(list)

obj = Example("test")
print(obj)  # Example(name='test', items=[])

Verify before relying

  • Whether the package's performance claims (no runtime penalties) have been benchmarked against dataclasses or manual implementations in recent versions.
  • Specific details on how field transformers and validators interact with the initialization process beyond what the changelog excerpt describes.

Package facts

LicenseMIT permissive
Python supportSupports the current Python release >=3.9
Install frictionLow. Pure-Python wheel
Runtime dependenciesNone
MaintenanceActively maintained 148 days since the last release
First released
Downloads924,894,579 / month, #28 on PyPI 30-day window, as of 2026-08-14
Known vulnerabilitiesNone known OSV.dev, checked 2026-08-14
Classifiers
Development Status :: 5 - Production/StableProgramming Language :: Python :: 3.10Programming Language :: Python :: 3.11Programming Language :: Python :: 3.12Programming Language :: Python :: 3.13Programming Language :: Python :: 3.14Programming Language :: Python :: 3.9Programming Language :: Python :: Implementation :: CPythonProgramming Language :: Python :: Implementation :: PyPyTyping :: Typed

Evidence: attrs-26.1.0-py3-none-any.whl

Tags

Capabilities
class boilerplate reductionautomatic __init__ and __repr__declarative class attributesdataclass alternativedunder method generation
Topics
class-generationboilerplate-reduction
PyPI keywords
attributeboilerplateclass

Let your AI agent find packages like this

Example. Real query, live index.

You found this page by searching. An agent finds it by wishing: SkillFed indexes 14,416 PyPI packages by what they can do, searchable in plain language.

wish › “class boilerplate reduction”

  • attrsattrs is a Python library that automatically generates common class…
  • fastapi-restfulProvides utilities and base classes to reduce boilerplate when…
  • django-annoyingProvides a collection of Django utility decorators and helper…

Give your agent the search over MCP, or paste the wish link into any chat.

Similar packages

attr Skip
PyPI · Python Modules · released Jul 2022

A decorator that attaches metadata attributes to functions or classes without repeating boilerplate code.

MITpure Pythonabandoned
441.7Kdownloads / mo
cattrs Worth it
PyPI · released Feb 2026

Converts unstructured dictionaries into properly typed Python classes and back, with recursive validation support for attrs classes, dataclasses, and standard collection types.

MITpure Python · 3.10+
73.8Mdownloads / mo
fields Skip
PyPI · Utilities · released Apr 2016

Generates lightweight container classes with automatic `__repr__`, comparison methods, and field initialization from a fluent attribute-chain syntax, eliminating boilerplate for simple data holders.

No, not for new projects.

BSD-3-Clausepure Pythonabandoned
78.8Kdownloads / mo
desert With conditions
PyPI · Utilities · released Sep 2022

Desert generates marshmallow serialization schemas automatically from dataclasses and attrs classes, eliminating the need to write separate schema definitions.

However, proceed with caution: the package is abandoned and no longer maintained, so you should verify it works with your current dependency versions and be prepared…

MITpure Python · 3.6+abandoned
130.6Kdownloads / mo
jsons With conditions
PyPI · Software Development · released Jun 2022

Converts Python objects (dataclasses, attrs classes, and plain objects) to JSON-serializable dicts and strings, and deserializes them back to typed instances.

Install it if your project's Python version and dependencies are stable; avoid it if you need active maintenance or cutting-edge typing support.

MITpure Python · 3.5+dormant
1.5Mdownloads / mo
jaraco.classes With conditions
PyPI · released Mar 2024

Provides utility functions for working with Python class constructs and class-related patterns.

MITpure Python · 3.8+
231.7Mdownloads / mo

See also types-attrs · dataclass-factory · py-avro-schema · dataclass-wizard