Data Records, or plain data objects, are used to group related fields together in a single place. Python provides a number of ways of doing this grouping, including using the dict
type, object oriented mechanisms such as classes and data classes, and the struct
library’s Struct
object for binary records.
Here are resources and additional documentation about records, dataclasses, and structs:
- dataclasses – Data Classes | Python Documentation
- typing – Support for type hints:NamedTuple | Python Documentation
- struct – Interpret bytes as packed binary data | Python Documentation
- Data Classes in Python 3.7+ (Guide) - Real Python Article
- Immutable Data Structures: namedtuple - Real Python Lesson