traits
Observable typed attributes for Python classes (by enthought)
dataclasses
By ericvsmith
traits | dataclasses | |
---|---|---|
3 | 3 | |
438 | 586 | |
0.5% | - | |
6.7 | 0.0 | |
19 days ago | 5 months ago | |
Python | Python | |
GNU General Public License v3.0 or later | Apache License 2.0 |
The number of mentions indicates the total number of mentions that we've tracked plus the number of user suggested alternatives.
Stars - the number of stars that a project has on GitHub. Growth - month over month growth in stars.
Activity is a relative number indicating how actively a project is being developed. Recent commits have higher weight than older ones.
For example, an activity of 9.0 indicates that a project is amongst the top 10% of the most actively developed projects that we are tracking.
Stars - the number of stars that a project has on GitHub. Growth - month over month growth in stars.
Activity is a relative number indicating how actively a project is being developed. Recent commits have higher weight than older ones.
For example, an activity of 9.0 indicates that a project is amongst the top 10% of the most actively developed projects that we are tracking.
traits
Posts with mentions or reviews of traits.
We have used some of these posts to build our list of alternatives
and similar projects. The last one was on 2021-12-24.
- GitHub - enthought/traits: Observable typed attributes for Python classes
- Traits: Observable typed attributes for Python classes
-
Attrs – The One Python Library Everyone Needs
My favourite among this class of Python libraries has been traits from Enthought:
https://github.com/enthought/traits
dataclasses
Posts with mentions or reviews of dataclasses.
We have used some of these posts to build our list of alternatives
and similar projects. The last one was on 2021-12-24.
-
Attrs – The One Python Library Everyone Needs
dataclasses was explicitly inspired by attrs. https://github.com/ericvsmith/dataclasses/issues/1
-
What is the expression “!r” in Python?
I have only just encountered this expression — the “!r” appended to a variable or class attribute, as in the following example from the Dataclasses backports repo for Python 3.6:
- What is the expression “!r” in Python (without quotes)? What does it mean? (See linked example in Dataclasses backports repo)
What are some alternatives?
When comparing traits and dataclasses you can also consider the following projects:
pydantic - Data validation using Python type hints
Box - Python dictionaries with advanced dot notation access
dotwiz - A blazing fast dict subclass that supports dot access notation.
DottedDict - Python library that provides a method of accessing lists and dicts with a dotted path notation.
polyfactory - Simple and powerful factories for mock data generation
bidict - The bidirectional mapping library for Python.
CPython - The Python programming language
attrs - Python Classes Without Boilerplate
pydantic-factories - Simple and powerful mock data generation using pydantic or dataclasses