attrs: Classes Without Boilerplate

Release v17.2.0 (What’s new?).

attrs is the Python package that will bring back the joy of writing classes by relieving you from the drudgery of implementing object protocols (aka dunder methods).

Its main goal is to help you to write concise and correct software without slowing down your code.

If you want to know how this looks like, jump right into Overview. If you really want to see attrs in action, Examples will give you a comprehensive rundown of its features. If you’re skeptical and want to know how it works first, check out “How Does It Work?”.

Testimonials

I’m looking forward to is being able to program in Python-with-attrs everywhere. It exerts a subtle, but positive, design influence in all the codebases I’ve see it used in.

Glyph Lefkowitz, creator of Twisted, Automat, and other open source software, in The One Python Library Everyone Needs

I’m increasingly digging your attr.ocity. Good job!

Łukasz Langa, prolific CPython core developer and Production Engineer at Facebook

Writing a fully-functional class using attrs takes me less time than writing this testimonial.

Amber Hawkie Brown, Twisted Release Manager and Computer Owl

attrs—classes for humans. I like it.

Kenneth Reitz, author of requests, Python Overlord at Heroku, on paper no less

Project Information

attrs is released under the MIT license, its documentation lives at Read the Docs, the code on GitHub, and the latest release on PyPI. It’s rigorously tested on Python 2.7, 3.4+, and PyPy.

If you’d like to contribute you’re most welcome and we’ve written a little guide to get you started!

Indices and tables