attr
Simple decorator to set attributes of target function or class in a DRY way.
Decision gist · record as of 2026-08-14
No. The package is abandoned (last release 2022-07-13, no commits since), and namespace shadowing issues are documented in its own description. For new projects, consider alternatives. For legacy code already using attr, migration is advisable to avoid import collision.AI-flagged interpretation of the facts on this page — verify before relying
Before you install
- A popular package named attrs now shadows this module's import name; the fact sheet recommends using the dry_attr alias instead to avoid conflicts.
- Installation is frictionless with no runtime dependencies.
- However, the package is abandoned—last release was 2022-07-13 with no recent repository activity.
License · maintenance · safety
MIT (permissive) — MIT license permits free use, modification, and distribution with minimal restrictions, suitable for both open and proprietary projects.
last release 2022-07-13 (1493 days) · last repo commit 2022-07-21 · 10 stars
0 known vulnerabilities (OSV.dev, 2026-08-14) · 441,722 downloads/mo, #6,642 on PyPI
Alternatives
Verify before relying
pip install attr
from attr import attr
@attr(short_description='Field', admin_order_field='real_field')
def my_calculated_field():
pass- Whether the namespace collision with the popular attrs package causes import or runtime issues in modern Python.
- Whether Python 2.7 support listed in classifiers remains functional or is purely historical.
- Current compatibility with modern Python versions given the 1493 days since last release.
What it is and what it does
attr is a lightweight decorator for attaching metadata to Python functions and classes without repeating configuration code. It was designed to reduce boilerplate when setting Django admin field attributes like short_description and admin_order_field, allowing you to declare them once as decorator arguments instead of assigning them after function definition.
The package has been abandoned since 2022-07-13 and is now overshadowed by a more popular package that uses the same import name, creating namespace conflicts. With no runtime dependencies and a permissive MIT license, it installs cleanly, but its lack of maintenance and the naming collision make it a poor choice for new projects.
Use it for
- Reduce repetition when setting Django admin metadata on calculated fields without separate assignment statements.
- Attach custom attributes to functions or classes using decorator syntax instead of post-definition assignment.
- Legacy Django projects that need minimal decorator support for metadata attachment.
Worth the install?
AI-flagged interpretation of the facts on this page. Verify before relying on it.
No.
The package is abandoned (last release 2022-07-13, no commits since), and namespace shadowing issues are documented in its own description. For new projects, consider alternatives. For legacy code already using attr, migration is advisable to avoid import collision.
Install
attr on PyPI
Before you install
Installation is frictionless with no runtime dependencies. However, the package is abandoned—last release was 2022-07-13 with no recent repository activity.
A popular package named attrs now shadows this module's import name; the fact sheet recommends using the dry_attr alias instead to avoid conflicts.
License in practice
MIT license permits free use, modification, and distribution with minimal restrictions, suitable for both open and proprietary projects.
Quickstart
pip install attr
from attr import attr
@attr(short_description='Field', admin_order_field='real_field')
def my_calculated_field():
pass
Verify before relying
- Whether the namespace collision with the popular attrs package causes import or runtime issues in modern Python.
- Whether Python 2.7 support listed in classifiers remains functional or is purely historical.
- Current compatibility with modern Python versions given the 1493 days since last release.
Package facts
| License | MIT permissive |
| Python support | Not specified |
| Install friction | Low. Pure-Python wheel |
| Runtime dependencies | None |
| Maintenance | Abandoned 1,493 days since the last release |
| Last repo commit | |
| First released | |
| Downloads | 441,722 / month, #6,642 on PyPI 30-day window, as of 2026-08-14 |
| Known vulnerabilities | None known OSV.dev, checked 2026-08-14 |
| Classifiers | License :: OSI Approved :: MIT LicenseOperating System :: OS IndependentProgramming Language :: Python :: 2.7Programming Language :: Python :: 3Topic :: Software Development :: Libraries :: Python Modules |
Evidence: attr-0.3.2-py2.py3-none-any.whl
Tags
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 › “function decorator metadata”
- attrA decorator that attaches metadata attributes to functions or classes…
- decopatchDecopatch simplifies writing decorators in Python by handling the…
- attributes-docExtracts and stores docstrings for class attributes at runtime,…
Give your agent the search over MCP, or paste the wish link into any chat.
More Python Modules packages
Converts domain names between Unicode and ASCII-compatible encoding (Punycode) according to IDNA 2008 and Unicode Technical Standard 46, with security validation and broader script coverage than the standard library.
Install it if you work with internationalized domain names, need to validate domains, or use HTTP clients that depend on it transitively.
Setuptools is a Python build backend and package management tool that handles building, distributing, and installing Python packages, including support for C/C++ extension modules.
PyYAML parses and emits YAML 1.1 data format, enabling serialization and deserialization of configuration files and Python objects to and from human-readable YAML text.
Pydantic validates Python data structures against type hints, coercing and checking input at runtime to ensure it matches a declared schema.
Provides reusable metadata objects for use with PEP-593 `typing.Annotated` to express common constraints like bounds, collection sizes, and predicates on types.
Install it if you use or build libraries that need to express type constraints in a standardized, inspectable way—or if you want to annotate your own types with…
Provides runtime tools to inspect and introspect Python type annotations, enabling programmatic examination of type hints at execution time.
See also attrs · django-annoying · decopatch · attrdict · fields · dry-rest-permissions · Autologging · django-widget-tweaks · desert · icontract