--- id: attr version: "0.3.2" license: MIT license_treatment: permissive maintenance: abandoned --- # attr — Simple decorator to set attributes of target function or class in a DRY way. License: permissive · Maintenance: abandoned · Downloads: 441.7K/mo ## 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 above — verify before relying. A decorator that attaches metadata attributes to functions or classes without repeating boilerplate code. 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 pip install attr uv add attr poetry add attr ## Installing attr 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. 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 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. 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: unspecified - Install friction: low - Maintenance: abandoned - Downloads: 441.7K/month (top 15,000 on PyPI) - Known vulnerabilities: none known ## Tags function decorator metadata, django admin field attributes, dry decorator pattern, function attribute decorator, reduce boilerplate attributes, decorator, abandoned, django [View on SkillFed](https://skillfed.io/packages/attr) · [View on PyPI](https://pypi.org/project/attr/)