--- id: abstractcp version: "1.0.0" license: unclear license_treatment: permissive maintenance: aging --- # abstractcp — Create abstract class variables License: permissive · Maintenance: aging · Downloads: 76.6K/mo ## What it is and what it does AbstractCP provides a way to define abstract class properties—class-level configuration that subclasses must explicitly set—with support for Python's type hints and static type checkers like mypy. You inherit from the `Abstract` base class and mark required class properties using `abstract_class_property(type)`, which enforces that concrete subclasses provide a value and raises a `TypeError` if they don't. This solves a gap in Python's standard `abc` module, which has no built-in mechanism for abstract class variables. The package is designed to be lightweight and Pythonic: it does all validation at class definition time (no runtime overhead), integrates cleanly with type hints, and produces clear error messages when a subclass forgets to define a required property. It supports multi-level inheritance—an abstract class can have abstract children—and works with Python 3.8 and higher. Use it for: - Define a base parser class with an abstract PATTERN property that each parser subclass must set before use. - Create a base array/tensor class that requires subclasses to declare their DIMENSIONS as a class constant. - Enforce that configuration subclasses define required settings (e.g., API endpoint, database URL) at class definition time. - Build plugin systems where each plugin subclass must declare its name, version, or handler type. - Ensure type-safe class hierarchies where mypy validates that abstract properties are satisfied before instantiation. ## Worth the install? AI-flagged interpretation of the facts above — verify before relying. Allows you to define abstract class properties that subclasses must implement, enforcing required configuration at class definition time with static type-checker support. Yes, if you need to enforce required class-level configuration in inheritance hierarchies and want static type-checker support. The package is small, has no dependencies, and solves a real gap in Python's standard library. The aging maintenance status is not a blocker for a stable, narrow-scope tool, but verify that the pattern fits your use case—it is not a general-purpose utility. ## Install pip install abstractcp uv add abstractcp poetry add abstractcp ## Installing abstractcp Before you install: Low install friction; pure Python wheel with no runtime dependencies. Maintenance is aging—last release was 2024-05-20 and last commit 2026-01-04, with minimal repository activity (9 stars), but no active issues reported. License in practice: MIT license permits commercial and private use with minimal restrictions; you may use, modify, and distribute freely provided you include the license notice. Quickstart: pip install abstractcp import abstractcp as acp class Parser(acp.Abstract): PATTERN: str = acp.abstract_class_property(str) class MyParser(Parser): PATTERN = r"my_pattern" # Attempting to instantiate Parser directly or a subclass without PATTERN raises TypeError Requires Python 3.8 or higher; abstract properties must be defined in classes that inherit directly from acp.Abstract. Verify before relying: - Whether the package is actively maintained or in maintenance-only mode given the aging status and sparse commit history. - Real-world adoption patterns beyond the stated download count to assess whether the pattern it solves is widely needed. ## Package facts - License: not declared (permissive) - Python support: supports_current - Install friction: low - Maintenance: aging - Downloads: 76.6K/month (top 15,000 on PyPI) - Known vulnerabilities: none known ## Tags abstract class properties python, abstract class variables, enforce class configuration, abstract class constants, class property inheritance, abstract-classes, type-hints, class-properties [View on SkillFed](https://skillfed.io/packages/abstractcp) · [View on PyPI](https://pypi.org/project/abstractcp/)