Skip to content
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

Unparsing? #7

Open
jthrilly opened this issue Dec 2, 2023 · 3 comments
Open

Unparsing? #7

jthrilly opened this issue Dec 2, 2023 · 3 comments
Labels
enhancement New feature or request

Comments

@jthrilly
Copy link

jthrilly commented Dec 2, 2023

Sorry for the issue spam (maybe you could open the discussions feature up?) but I was wondering if you have plans for or interest in implementing unparsing (CSV to JS collection). I love the approach you have taken here, but I am looking for a parse/unparse combined solution in my project. I would be happy to try to contribute toward development.

@leeoniya
Copy link
Owner

leeoniya commented Dec 2, 2023

hey fellow chicago dweller :)

yeah i think adding unparsing is fine, i kinda figured it would be requested eventually. im thinking something that uses the existing schema for options as much as possible/makes sense.

leeoniya added a commit that referenced this issue Dec 4, 2023
@leeoniya
Copy link
Owner

leeoniya commented Dec 4, 2023

started some unparse work in bd533b0. currently:

  • only unparsing from array of tuples or objects for now (still missing columnar and deep objects unparsing)
  • no schema inference function and no header customization (just uses what's in supplied schema)
  • perf looks to be about 2x-3x faster than Papaparse

not super sure about the API.

bd533b0#diff-4d5318447ff8d96281084320d0aa05527c243618044cede1bfa99881cba4a16d

  • might need multiple schema inference functions (or opts) cause it's not possible to disambiguate deep vs shallow objects and tuples vs columnar arrays. inferArrs, inferObjs, inferCols, inferDeep.
  • the current approach of allowing to pinky-swear away the need for quoting string fields doesnt feel great, and maybe is not necessary

@leeoniya leeoniya added the enhancement New feature or request label Feb 26, 2024
leeoniya added a commit that referenced this issue Nov 4, 2024
leeoniya added a commit that referenced this issue Nov 4, 2024
@leeoniya
Copy link
Owner

leeoniya commented Nov 4, 2024

(i've moved this WIP work to the unparse branch)

leeoniya added a commit that referenced this issue Nov 4, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Projects
None yet
Development

No branches or pull requests

2 participants