-
Notifications
You must be signed in to change notification settings - Fork 1
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
feat: Use csv.DictReader to parse header fields (msto#19) #20
base: main
Are you sure you want to change the base?
Conversation
Thanks for the PR!
I’m OOO this week but will take a look next week. Bump this thread if you
don’t get a review by Wednesday
…On Wed, Nov 27, 2024 at 11:36 AM Boston Walker ***@***.***> wrote:
Used csv.DictReader() to do the dirty work because RFC4180 has lots of
tricky rules around quoting and special characters. Added a test to
demonstrate. Tested using Python 3.10, 3.11, and 3.12.
------------------------------
You can view, comment on, or merge this pull request online at:
#20
Commit Summary
- 4a9261d
<4a9261d>
feat: Use csv.DictReader to parse header fields (msto#19)
File Changes
(5 files <https://github.com/msto/dataclass_io/pull/20/files>)
- *M* dataclass_io/_lib/assertions.py
<https://github.com/msto/dataclass_io/pull/20/files#diff-97aa5c3f1e48336161c15d79baa20e4fab0c41f1186130bdf3f01f4a342f2e54>
(5)
- *M* dataclass_io/_lib/file.py
<https://github.com/msto/dataclass_io/pull/20/files#diff-16c13789c00ee4b2871a20f0f8be05e75fda0d236911b2727bfcd17bbd2471f2>
(11)
- *M* dataclass_io/reader.py
<https://github.com/msto/dataclass_io/pull/20/files#diff-c69224ddcf5e4873be0f12e2527a3c225dff2a8af308ab52a9a636f503627c3f>
(7)
- *M* dataclass_io/writer.py
<https://github.com/msto/dataclass_io/pull/20/files#diff-3ea12af2879db2dfd31bbc17a5f1207ea7912a6e67450cc34c089976f86f1903>
(4)
- *M* tests/test_reader.py
<https://github.com/msto/dataclass_io/pull/20/files#diff-88ac3b584a5505d52ad940bf74289789a177ce60ae6852ba4d245b362612afd1>
(27)
Patch Links:
- https://github.com/msto/dataclass_io/pull/20.patch
- https://github.com/msto/dataclass_io/pull/20.diff
—
Reply to this email directly, view it on GitHub
<#20>, or unsubscribe
<https://github.com/notifications/unsubscribe-auth/AAANOFNL2KOO3XXTZT7YCGT2CXYHHAVCNFSM6AAAAABSTIJ7XOVHI2DSMVQWIX3LMV43ASLTON2WKOZSGY4TSMJSGU4DKMY>
.
You are receiving this because you are subscribed to this thread.Message
ID: ***@***.***>
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Hey, thanks again for the PR.
I think I should have initially included the dialect
parameter in the Reader and Writer classes, and permitted other arguments such as quoting
to be passed through as kwargs, similar to DictReader
's interface.
https://docs.python.org/3/library/csv.html#csv.DictReader
Would there be any reasons to favor keeping quoting
as an explicit argument if that change were made?
I think I only included it for consistency. |
Used csv.DictReader() to do the dirty work because RFC4180 has lots of tricky rules around quoting and special characters. Added a test to demonstrate. Tested using Python 3.10, 3.11, and 3.12.