Metadata-Version: 2.4
Name: dynrepr
Version: 1.0.0
Summary: Decorator factory to help create class __repr__ functions.
Author-email: nythepegasus <me@nythepegas.us>
Maintainer-email: nythepegasus <me@nythepegas.us>
License-Expression: MIT
Project-URL: Repository, https://github.com/nythepegasus/dynrepr.git
Project-URL: Bug Tracker, https://github.com/nythepegasus/dynrepr/issues
Classifier: Development Status :: 5 - Production/Stable
Classifier: Intended Audience :: Developers
Classifier: Natural Language :: English
Classifier: Operating System :: OS Independent
Classifier: Programming Language :: Python :: 3.8
Classifier: Programming Language :: Python :: 3.14
Classifier: Topic :: Software Development :: Libraries :: Python Modules
Classifier: Topic :: Utilities
Classifier: Typing :: Typed
Requires-Python: >=3.8
Description-Content-Type: text/markdown
License-File: LICENSE
Dynamic: license-file

# dynrepr
Decorator factory to help create class `__repr__` functions.

### Example Usage:
```py
# old
class Point:
    def __init__(self, x: int, y: int):
        self.x = x
        self.y = y

print(Point(1, 2))
# <__main__.Point object at 0x848469690>

# new
from dynrepr import dynrepr

@dynrepr
class Point:
    def __init__(self, x: int, y: int):
        self.x = x
        self.y = y

print(Point(1, 2))
# Point(x=1, y=2)
```

### Advanced Usage:
```py
from dynrepr import dynrepr

@dynrepr('x', 'y')
class FilterValuesPoint:
    def __init__(self, x: int, y: int, z: int):
        self.x = x
        self.y = y
        self.z = z

print(FilterValuesPoint(4, 6, 8))
# FilterValuesPoint(x=4, y=6)

@dynrepr(filters=[lambda v: 4 < v < 8])
class FilteredSubclassPoint(FilterValuesPoint): pass

print(FilteredSubclassPoint(4, 6, 8))
# FilteredSubclassPoint(y=6)
```

### Installation
```sh
pip install dynrepr
```

#### [MIT License](https://raw.githubusercontent.com/nythepegasus/dynrepr/refs/heads/main/LICENSE)

