Intro
attrsx
β A Lightweight, Playful Extension to attrs
π§ What is attrsx
?
attrsx
is a minimal, lightweight extension of the popular attrs
library, designed to seamlessly add logging capabilities to your attrs
classes.
β¨ What It Does:
- π οΈ Extends
attrs.define
β Behaves exactly likeattrs.define
, but with automatic logger initialization. - ποΈ Built-in Logging Fields β Adds fields for logger name, level, and format β all customizable per class or instance.
- π Non-Intrusive β If you donβt need logging,
attrsx
functions just like plain oldattrs
.
π― Why attrsx
?
- π You sometimes just want simple logging without writing the same boilerplate over and over.
- π
attrsx
lets you keep things clean β adding just a little "magic" toattrs
-based classes. - π± Itβs
attrs
, but with room for playful future extensions.
π§ Features at a Glance:
- β
Fully compatible with
attrs
22.2.0 and later. - π§© Supports all
attrs.define
parameters β likeslots
,frozen
, and more. - π§ Logger defaults to the class name but can be overridden effortlessly.
β¨ Itβs attrs
, but with just a little... extra. π
Installation
pip install attrsx