Popularity
2.3
Growing
Activity
5.9
Declining
149
9
24

Description

Python has a rich set of powerful, easy to use, built-in data types like dictionaries, lists and tuples. These data types are also the lingua franca of most data serialization libraries, for formats like json, msgpack, yaml or toml.

Data types like this, and mappings like dict s in particular, represent unstructured data. Your data is, in all likelihood, structured: not all combinations of field names are values are valid inputs to your programs. In Python, structured data is better represented with classes and enumerations. attrs is an excellent library for declaratively describing the structure of your data, and validating it.

When you're handed unstructured data (by your network, file system, database...), cattrs helps to convert this data into structured data. When you have to convert your structured data into data types other libraries can handle, cattrs turns your classes and enumerations into dictionaries, integers and strings.

Here's a simple taste. The list containing a flo

Programming language: Python
License: MIT License

cattrs alternatives and related packages

Based on the "Serialization" category

Do you think we are missing an alternative of cattrs or a related project?

Add another 'Serialization' Package

cattrs Recommendations

There are no recommendations yet. Be the first to promote cattrs!

Have you used cattrs? Share your experience. Write a short recommendation and cattrs, you and your project will be promoted on Awesome Python.
Recommend cattrs

Recently added cattrs resources

Do you know of a useful tutorial, book or news relevant to cattrs?
Be the first to add one!