dataclass-csv
dataclass-csv copied to clipboard
Map CSV to Data Classes
When reading datetime fields from a file the @dateformat() works well but when writing the same dataclass with DataclassWriter it does not write them to the file in this format.
It seems that `distutils` will be soon be obsolete. ``` /usr/local/lib/python3.10/site-packages/dataclass_csv/dataclass_reader.py:5 /usr/local/lib/python3.10/site-packages/dataclass_csv/dataclass_reader.py:5: DeprecationWarning: The distutils package is deprecated and slated for removal in Python 3.12. Use setuptools or check PEP...
This generalises #17. Currently any class not special-cased by the library must have a constructor that takes a single string. Even for built-in types this leads to workarounds like the...
This generalises #20. I completed the example from the README. The following works. ```python import dataclasses import io import re from dataclass_csv import DataclassReader class SSN: def __init__(self, val): if...
While the existing datetime support is nice, some additional flexibility would be nice. When reading date strings, for example, the ability to use a well known parser such as [dateutil.parser](https://dateutil.readthedocs.io/en/stable/parser.html)...
I came across this problem when trying to work around #17. Given a data file with a column 'date', which contains an integer (a unix timestamp), and a dataclass with...
Closes #56 Makes DataclassReader a generic class, which returns objects of that type
When reading a csv file, it would be nice if when iterating through DataclassReader the type checker could recognise the objects as being the type that the DataclassReader was instantiated...
If I try to create a DataclassWriter with the keyword argument `delimiter = ';'`, Python's type checker (I'm using Pyright) will report this error: ``` Argument of type "Literal[';']" cannot...
Say If I have the following classes for serialization to csv. ```python @dataclass class Link: title: str url: str @dataclass class SearchResult: paper_name: Link authors: list[Link] publication: Link ``` I...