attrs: Attributes Without Boilerplate

Release v16.1.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, inventor of Twisted and Software Developer at Rackspace 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

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.

Indices and tables