A simple decorator for customizing Python object representations
Project description
Custom Repr
A simple decorator to add pretty representation to Python classes.
Installation
pip install custom-repr
Usage
from custom_repr import add_repr
# Apply this decorator to automatically enhance your class with a custom __repr__ method, providing a better representation of object.
@add_repr
class Person:
def __init__(self, name, age):
self.name = name
self.age = age
person = Person("John", 30)
print(person) # Person(name: "John", age: 30)
Project details
Release history Release notifications | RSS feed
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
custom_repr-0.1.0.tar.gz
(2.5 kB
view details)
Built Distribution
Filter files by name, interpreter, ABI, and platform.
If you're not sure about the file name format, learn more about wheel file names.
Copy a direct link to the current filters
File details
Details for the file custom_repr-0.1.0.tar.gz.
File metadata
- Download URL: custom_repr-0.1.0.tar.gz
- Upload date:
- Size: 2.5 kB
- Tags: Source
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/6.1.0 CPython/3.12.8
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
9d29d29f2141c9c74977574860af70c39ad51f4ebc32563b2cad4a5d6d770be5
|
|
| MD5 |
62d311ec78ce3e71380f310e092a8bc3
|
|
| BLAKE2b-256 |
ca83755e59717070a0d5168295f678f0043c7ff1da3b8ca242112ad2799effd7
|
File details
Details for the file custom_repr-0.1.0-py3-none-any.whl.
File metadata
- Download URL: custom_repr-0.1.0-py3-none-any.whl
- Upload date:
- Size: 2.9 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/6.1.0 CPython/3.12.8
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
7ba7b4f79f9a25fdc1c33e6bdef9efbba31d02186b826c846d385756731732d3
|
|
| MD5 |
b85e1e22c8de1e52afde9bc75a8b0508
|
|
| BLAKE2b-256 |
c427b4f9b419f12300541b6eb41e49780c0175c31516a06af6bd018303fc5287
|