Metadata-Version: 2.4
Name: python-pact
Version: 0.1.1
Summary: A lightweight Python metaclass for enforcing required attributes and types in class hierarchies
Author-email: Omer Menashe <unspecified@mail.com>
License: MIT
Project-URL: Source, https://github.com/iamomerm/python-pact
Keywords: python-pact,pact
Classifier: Programming Language :: Python :: 3
Classifier: License :: OSI Approved :: MIT License
Classifier: Operating System :: OS Independent
Requires-Python: >=3.7
Description-Content-Type: text/markdown
License-File: LICENSE
Dynamic: license-file

## <ins> Pact: Attribute Enforcement Metaclass for Python </ins>

Pact is a lightweight Python metaclass designed to enforce the presence and types of class attributes in subclasses <br>
It helps you ensure that all subclasses implement the required attributes declared in the base class, <br>
catching missing or mistyped attributes early with warnings and exceptions <br>

### <ins> Features </ins>

- Enforce presence of specific class or instance attributes in subclasses
- Type validation of annotated attributes
- Raises PactException exception and emits warnings for missing or mismatched attributes

### <ins> Installation </ins>

You can install this package via PIP: pip install python-pact

### <ins> Usage </ins>

```python
from pact import Pact


class Person(Pact):
    name: str
    age: int


class JohnDoe(Person):
    name = 'John Doe'
    age = 25


# This will raise PactException due to missing 'age':
class JaneDoe(Person):
    name = 'Jane Doe'
```
