Replies: 3 comments 13 replies
-
Yes @kindly , I would love to integrate flatterer and csvs_convert into qsv and get to output to other formats beyond CSV/TSV and JSONL. Enabling the creation of datapackage files thru the csvs_convert library would be a welcome addition as well! (A little sidenote, I was originally looking to use JSON Table Schema when we first started implementing the As for "heavy" dependencies, I'm not as concerned, so long as that at the end of the day, we can produce binaries for Linux, MacOS and Windows, and Homebrew can continue to package it up for quick installation. As it is, qsv has some "heavy" dependencies with c bindings - it uses the mimalloc allocator by default via the mimalloc_rust crate; and the Like you suggested, we can manage these dependencies across the different target platform by making judicious use of feature flags and accounting for them in the publishing GH Action workflows. |
Beta Was this translation helpful? Give feedback.
-
@jqnatividad thanks for merging! Your changes look good. I will try to add some testing next. For my other projects I am using a testing library called: https://docs.rs/insta/latest/insta/ It is by far my favourite way to test output and would make adding tests for this much easier as I already have them in csvs_convert. Also I am going to get csvs_convert to detect and use index files. |
Beta Was this translation helpful? Give feedback.
-
insta.rs looks good! As you may have noticed, I often point to the tests as extended examples in the docopt usage text. So as long as the test makes sense to a regular qsv user, go for it! And yeah, anything to make qsv commands faster... as speed, apart from composability and simplicity, is a main goal of qsv. Speaking of composability, once the tests are setup, maybe we can revisit that so users can pipe CSVs to |
Beta Was this translation helpful? Give feedback.
-
There are two libraries that I maintain that have a strong overlap and could potentially be integregrated with qsv. Both of these are rust libraries but currenly do not have rust CLI. I just descovered qsv and am wondering if it would be better to add them to qsv instead of making a seperate CLI for them.
flatterer
This flattens deeply nested JSON by producing muliple CSV files, one for each one-to-many (array of objects) relationship. It also outputs to other formats SQLITE/PARQUET/POSTGRES/XLSX.
csvs_convert - rust library
This is used by the above, but is a seperate library, to convert CSV files to SQLITE/PARQUET/POSTGRES/XLSX efficiently. It has its own type guesser (like the qsv stats command) but produces a datapackage.json as the metadata format instead of jsonschema (this is because foreign key relationships can be described in datapackages). One of the next things for this library was to provide more stats like the
stats
command. I also wonder here if there is any collaboration that could go on so that type guessing and stats parts could be shared.So it would be great to have opinions on if integrating these libraries into new qsv commands is a good idea?
The main drawbacks are is they are fairly heavy in terms of dependancies and both sqlite and xlsx output require c binding (as the c libraries are the fastest and most fully featured, rustqlite and libxlsxwriter). I could easily add feature flags to remove these though. Mostly they compile easily though as the it uses non system versions of these dependancies.
Beta Was this translation helpful? Give feedback.
All reactions