<commit_before><p align="center">
   <a href="https://www.attrs.org/">
      <picture>
         <source srcset="https://raw.githubusercontent.com/python-attrs/attrs/main/docs/_static/attrs_logo_white.svg" media="(prefers-color-scheme: dark)">
         <img src="https://raw.githubusercontent.com/python-attrs/attrs/main/docs/_static/attrs_logo.svg" width="35%" alt="attrs" />
      </picture>
   </a>
</p>

<p align="center">
   <a href="https://www.attrs.org/en/stable/">
       <img src="https://img.shields.io/badge/Docs-RTD-black" alt="Documentation" />
   </a>
   <a href="https://github.com/python-attrs/attrs/blob/main/LICENSE">
      <img src="https://img.shields.io/badge/license-MIT-C06524" alt="License: MIT" />
   </a>
   <a href="https://bestpractices.coreinfrastructure.org/projects/6482"><img src="https://bestpractices.coreinfrastructure.org/projects/6482/badge"></a>
   <a href="https://pypi.org/project/attrs/">
      <img src="https://img.shields.io/pypi/v/attrs" />
   </a>
   <a href="https://pepy.tech/project/attrs">
      <img src="https://static.pepy.tech/personalized-badge/attrs?period=month&units=international_system&left_color=grey&right_color=blue&left_text=Downloads%20/%20Month" alt="Downloads per month" />
   </a>
   <a href="https://zenodo.org/badge/latestdoi/29918975"><img src="https://zenodo.org/badge/29918975.svg" alt="DOI"></a>
</p>

<!-- teaser-begin -->

*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](https://www.attrs.org/en/latest/glossary.html#term-dunder-methods)).
[Trusted by NASA](https://docs.github.com/en/account-and-profile/setting-up-and-managing-your-github-profile/customizing-your-profile/personalizing-your-profile#list-of-qualifying-repositories-for-mars-2020-helicopter-contributor-achievement) for Mars missions since 2020!

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

<!-- teaser-end -->

## Sponsors

*attrs* could not be possible without our [amazing sponsors](https://github.com/sponsors/hynek).
Especially those generously sponsoring us at *The Organization* level and higher:

<p align="center">
   <a href="https://www.variomedia.de/">
      <img src="./docs/_static/sponsors/Variomedia.svg" width="200" height="60"></img>
   </a>

   <a href="https://tidelift.com/subscription/pkg/pypi-attrs?utm_source=pypi-attrs&utm_medium=referral&utm_campaign=enterprise&utm_term=repo">
      <img src="./docs/_static/sponsors/Tidelift.svg" width="200" height="60"></img>
   </a>

   <a href="https://filepreviews.io/">
      <img src="./docs/_static/sponsors/FilePreviews.svg" width="200" height="60"></img>
   </a>
</p>

<p align="center">
   <small>
      <strong>For a limited time, you can add your logo here for <a href="https://github.com/sponsors/hynek">as little as $50 per month!</a></strong>
   </small>
</p>


## Example

*attrs* gives you a class decorator and a way to declaratively define the attributes on that class:

<!-- code-begin -->

```pycon
>>> from attrs import asdict, define, make_class, Factory

>>> @define
... class SomeClass:
...     a_number: int = 42
...     list_of_numbers: list[int] = Factory(list)
...
...     def hard_math(self, another_number):
...         return self.a_number + sum(self.list_of_numbers) * another_number<commit_msg>Small doesn't do anything on GitHub<commit_after><p align="center">
   <a href="https://www.attrs.org/">
      <picture>
         <source srcset="https://raw.githubusercontent.com/python-attrs/attrs/main/docs/_static/attrs_logo_white.svg" media="(prefers-color-scheme: dark)">
         <img src="https://raw.githubusercontent.com/python-attrs/attrs/main/docs/_static/attrs_logo.svg" width="35%" alt="attrs" />
      </picture>
   </a>
</p>

<p align="center">
   <a href="https://www.attrs.org/en/stable/">
       <img src="https://img.shields.io/badge/Docs-RTD-black" alt="Documentation" />
   </a>
   <a href="https://github.com/python-attrs/attrs/blob/main/LICENSE">
      <img src="https://img.shields.io/badge/license-MIT-C06524" alt="License: MIT" />
   </a>
   <a href="https://bestpractices.coreinfrastructure.org/projects/6482"><img src="https://bestpractices.coreinfrastructure.org/projects/6482/badge"></a>
   <a href="https://pypi.org/project/attrs/">
      <img src="https://img.shields.io/pypi/v/attrs" />
   </a>
   <a href="https://pepy.tech/project/attrs">
      <img src="https://static.pepy.tech/personalized-badge/attrs?period=month&units=international_system&left_color=grey&right_color=blue&left_text=Downloads%20/%20Month" alt="Downloads per month" />
   </a>
   <a href="https://zenodo.org/badge/latestdoi/29918975"><img src="https://zenodo.org/badge/29918975.svg" alt="DOI"></a>
</p>

<!-- teaser-begin -->

*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](https://www.attrs.org/en/latest/glossary.html#term-dunder-methods)).
[Trusted by NASA](https://docs.github.com/en/account-and-profile/setting-up-and-managing-your-github-profile/customizing-your-profile/personalizing-your-profile#list-of-qualifying-repositories-for-mars-2020-helicopter-contributor-achievement) for Mars missions since 2020!

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

<!-- teaser-end -->

## Sponsors

*attrs* would not be possible without our [amazing sponsors](https://github.com/sponsors/hynek).
Especially those generously sponsoring us at the *The Organization* level and higher:

<p align="center">
   <a href="https://www.variomedia.de/">
      <img src="./docs/_static/sponsors/Variomedia.svg" width="200" height="60"></img>
   </a>

   <a href="https://tidelift.com/subscription/pkg/pypi-attrs?utm_source=pypi-attrs&utm_medium=referral&utm_campaign=enterprise&utm_term=repo">
      <img src="./docs/_static/sponsors/Tidelift.svg" width="200" height="60"></img>
   </a>

   <a href="https://filepreviews.io/">
      <img src="./docs/_static/sponsors/FilePreviews.svg" width="200" height="60"></img>
   </a>
</p>

<p align="center">
   <strong>For a limited time, you can add your logo here for <a href="https://github.com/sponsors/hynek">as little as $50 per month!</a></strong>
</p>


## Example

*attrs* gives you a class decorator and a way to declaratively define the attributes on that class:

<!-- code-begin -->

```pycon
>>> from attrs import asdict, define, make_class, Factory

>>> @define
... class SomeClass:
...     a_number: int = 42
...     list_of_numbers: list[int] = Factory(list)
...
...     def hard_math(self, another_number):
...         return self.a_number + sum(self.list_of_numbers) * another_number
{'fraction_non_alphanumeric': 0.18014598540145985, 'fraction_numerical': 0.018102189781021898, 'mean_word_length': 4.048636698599853, 'pattern_counts': {'":': 0, '<': 107, '<?xml version=': 0, '>': 119, 'https://': 44, 'lorem ipsum': 0, 'www.': 8, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 4, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '2512358', 'n_tokens_mistral': 2448, 'n_tokens_neox': 2299, 'n_words': 439}