skillfed

types-attrs

Typing stubs for attrs

types-attrs v19.1.0 194.6K downloads/30d#9,828 on PyPI5,108
Permissive license Apache-2.0 license Active released

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-attrs

uv

uv add types-attrs

poetry

poetry add types-attrs

Installing 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

License :: OSI Approved :: Apache Software LicenseTyping :: Typed

Tags

type stubs for attrsattrs type checkingmypy attrs supportpep 561 type stubsattrs typing annotationsstatic type checking attrs
type-stubstyping

More Software Development packages