Catalog PyPI
Back to packageRELEASE DETAILS

0.6.1

PyPI

abcattrs

Abstract class attributes

Published29 Sept 2025
Direct dependencies5
Transitive dependenciesNot calculated

README

Version 0.6.1 documentation

abcattrs

CI Build Status
PyPI Package Python versions

Abstract class attributes for ABCs.

Examples

import abc
from abcattrs import abstractattrs, Abstract


@abstractattrs
class A(abc.ABC):
    foo: Abstract[int]


# Abstract subclasses can add more required attributes.
class B(A, abc.ABC):
    bar: Abstract[str]


class C(B):
    # C must assign values to both of these attributes to not raise an error.
    foo = 1
    bar = "str"


# This raises an error.
class MissingBar(B):
    foo = 1


# This raises an error.
class MissingFoo(B):
    bar = "str"

The Abstract qualifier can be combined with other PEP 593 annotations.

from typing import Annotated
import abc
from abcattrs import abstractattrs, Abstract


@abstractattrs
class A(abc.ABC):
    # Combine with other annotations
    bar: Annotated[str, Abstract, "other info"]

Downloads & popularity

Awaiting observations

No metric observations yet

Download counts and popularity will appear here as the collector receives them.

Declared dependencies 6

Native requirements
5 direct targetsNot calculated transitive count
Package / targetRequirementRelationship
pytest
Environment
{
  "extras": "",
  "marker": "extra == \"test\"",
  "requires_python": ">=3.10",
  "evaluation": "NOT_EVALUATED"
}
pytest; extra == "test"runtime
pytest-mypy-plugins
Environment
{
  "extras": "",
  "marker": "extra == \"test\"",
  "requires_python": ">=3.10",
  "evaluation": "NOT_EVALUATED"
}
pytest-mypy-plugins; extra == "test"runtime
coverage
Environment
{
  "extras": "",
  "marker": "extra == \"test\"",
  "requires_python": ">=3.10",
  "evaluation": "NOT_EVALUATED"
}
coverage; extra == "test"runtime
mypy
Environment
{
  "extras": "",
  "marker": "extra == \"type-check\"",
  "requires_python": ">=3.10",
  "evaluation": "NOT_EVALUATED"
}
mypy; extra == "type-check"runtime
pytest
Environment
{
  "extras": "",
  "marker": "extra == \"type-check\"",
  "requires_python": ">=3.10",
  "evaluation": "NOT_EVALUATED"
}
pytest; extra == "type-check"runtime
types-setuptools
Environment
{
  "extras": "",
  "marker": "extra == \"type-check\"",
  "requires_python": ">=3.10",
  "evaluation": "NOT_EVALUATED"
}
types-setuptools; extra == "type-check"runtime

Distribution files

2 collected
abcattrs-0.6.1-py3-none-any.whl

bdist_wheel · 5.83 KB · Python py3

Source file
abcattrs-0.6.1.tar.gz

sdist · 5.33 KB · Python source

Source file

Repository

PENDING
antonagestam/abcattrs

Shared repository data · GitHub

License detected in repository
Not collected

Metadata history

Meaningful changes
Current collected state Current

Observed since 20 Oct, 17:13 UTC

No superseded metadata states collected. Unchanged observations do not create new revisions.

Record identity

package_version:e82a3bcee7d83aac967c28600bc7e4edcfa484d027b4fd7498dd4a0274f5ca0e

Other collected versions

View all collected versions →