types-attrs
Typing stubs for attrs
What it is and what it does
types-attrs is a PEP 561 type stub package auto-generated from typeshed that provides type information for the attrs library. It allows static type checkers—mypy, PyCharm, pytype, and others—to understand and validate code that uses attrs, catching type errors before runtime.
The package has no runtime dependencies and installs as a pure wheel. However, the description notes that attrs itself has included type annotations since version 18.2.0, making this stub package potentially unnecessary for users on newer attrs versions. The package has not been updated since 2021-06-06, which aligns with its role as a legacy compatibility shim.
Use it for:
- Type-check attrs-based code with mypy or other PEP 561-compatible type checkers when using older attrs versions.
- Provide IDE type hints in PyCharm or other editors for attrs classes and decorators.
- Validate attrs usage in a codebase that requires strict static type analysis.
- Support type checking in projects pinned to attrs versions before 18.2.0.
Worth the install?
AI-flagged interpretation of the facts on this page — verify before relying
Provides PEP 561 type stubs for the attrs package, enabling type checkers like mypy and PyCharm to validate code using attrs.
No—install this only if you are using attrs before version 18.2.0. For modern attrs (18.2.0 and later), uninstall this package and rely on attrs' native type annotations instead. The description explicitly recommends this approach.
Install
types-attrs on PyPI
pip
pip install types-attrsuv
uv add types-attrspoetry
poetry add types-attrsInstalling types-attrs
Before you install
Low install friction with a pure-wheel distribution. Maintenance is active with recent repository commits, though the package itself has not been updated since 2021-06-06; this is expected for a stub package that tracks typeshed.
License in practice
Apache-2.0 permissive license allows use in most projects without restriction.
Quickstart
pip install types-attrs
Then use with mypy or other PEP 561-compatible type checkers in your project configuration.
Only needed for attrs versions before 18.2.0; attrs 18.2.0 and later include native type annotations.
Verify before relying
- Whether this stub package remains actively maintained in typeshed for modern attrs versions.
- Compatibility matrix with current attrs releases and whether native annotations have fully superseded this package.
Package facts
| License | Apache-2.0 license (permissive) |
| Python support | not specified |
| Install friction | low — pure-Python wheel |
| Runtime dependencies | none |
| Maintenance | actively maintained — 1,895 days since the last release |
| Last repo commit | |
| First released | |
| Downloads | 194,600/month — #9,828 on PyPI (30-day window, as of 2026-08-14) |
| Known vulnerabilities | none known (OSV.dev, checked 2026-08-14) |
Evidence: types_attrs-19.1.0-py2.py3-none-any.whl
Tags
More Software Development packages
Provides backported and experimental type hints…
permissive · top 100 on PyPI
numpyNumPy provides an N-dimensional array object…
permissive · top 100 on PyPI
fastapiFastAPI is a Python web framework for building…
permissive · top 100 on PyPI
annotated-docProvides a way to document function parameters,…
permissive · top 100 on PyPI
typerTyper builds command-line applications from…
permissive · top 1,000 on PyPI
distlibDistlib provides low-level packaging utilities…
permissive · top 1,000 on PyPI
types-backportsProvides PEP 561 type stubs for the backports…
permissive · top 15,000 on PyPI
types-MarkupSafeProvides type stubs for MarkupSafe, enabling…
permissive · top 5,000 on PyPI
types-maxminddbProvides type stubs for the maxminddb package,…
permissive · top 15,000 on PyPI
types-orjsonProvides PEP 561 type stubs for the orjson…
permissive · top 15,000 on PyPI
types-clickProvides PEP 561 type stubs for the click…
permissive · top 5,000 on PyPI
types-dataclassesProvides type stubs for Python's dataclasses…
permissive · top 15,000 on PyPI
types-tornadoProvides PEP 561 type stubs for tornado,…
permissive · top 15,000 on PyPI
types-jwtProvides type stubs for the jwt package,…
permissive · top 15,000 on PyPI
data-science-typesProvides PEP-561-compliant type stubs for…
permissive · top 15,000 on PyPI
pybind11-stubgenGenerates PEP 561 type stubs for Python binary…
permissive · top 5,000 on PyPI