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,
attrsxfunctions just like plain oldattrs.
π― Why attrsx?
- π You sometimes just want simple logging without writing the same boilerplate over and over.
- π
attrsxlets 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
attrs22.2.0 and later. - π§© Supports all
attrs.defineparameters β 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