dataclass-csv
dataclass-csv copied to clipboard
Support to split object properties to separate columns.
Say If I have the following classes for serialization to csv.
@dataclass
class Link:
title: str
url: str
@dataclass
class SearchResult:
paper_name: Link
authors: list[Link]
publication: Link
I want to split paper_name
into paper_name.title
and paper_name.url
columns in the generated csv file.
See also https://github.com/dfurtado/dataclass-csv/issues/33#issuecomment-1314895347.
Maybe some annotation can be used on the classes of the property type to indicate the purpose.