Skip to content

Intro

PyPiVersion License

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 like attrs.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 old attrs.

🎯 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" to attrs-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 – like slots, 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