CsvPath Framework has had JSONL support for a while. It wasn't until we updated FlightPath Data to edit JSONL that I really started noticing how seriously free-wheeling JSONL is.
What Wouldn't JSONL Do?
Here are some of the quirks:
- There is no header order
- Headers change line-by-line...
- ...or is there one total set of headers that grows line-by-line?
- Arrays and dictionary lines can cohabitate
- Header values (using CsvPath terms; a.k.a. dictionary values) can be complex objects
- Array lines have headers that equal their values...
- ...or do array lines just not have headers?
- ...or are array indexes associated with the most recent headers?
- With all this header (a.k.a. column) uncertainty you may have to read the whole file to know what the shape of the data is so that you have a reference point for when you check the lines
All of this and more!
The Visualization Is Where They Get You
And it only gets more nuanced and nutty when you try to make a grid view editor. A simple editor has no useful way to show dictionary-line data. The compromises are a big deal. You can choose to make the headers an ever growing set and then sort them and display the data in the grid according to the sorted header name position, thereby allowing you to serialize the data back to JSONL. But that is a lot of choices that add up to a very particular way of handling the data that might not work for everyone.
We split the difference. FlightPath shows JSONL data in a grid view. However, it does not attempt to show any headers. And if you edit the data in the grid view you have to save it as CSV. Since that's a lot of compromise, we made it possible to use the JSON editing view for JSONL. That gives you syntax highlighting, pretty printing (JSONL style!), and full control of the data, but at the cost of the greater productivity you would have had a grid view.
So Why JSONL?
JSONL is great for data that is less tabular or fluctuates even more wildly than CSV does. It gives cleaner programmatic access to the contents of each line. In most cases, JSONL's key based access is both self-documenting at a line level, albeit leaving it a bit harder to understand the file as a whole, and keeps you from having to access data through indexes. And while it is more verbose for many purposes, JSONL can potentially save significant space in certain wide and sparse use cases.
All that said, if you're a stickler for correctness, control, and referenceable validity, JSONL might give you hives. Even more than CSV. And that's saying something.
If you're feeling the need for an antidote to crazy JSONL, CSV, and Excel data, checkout CsvPath Framework and FlightPath Data.
Top comments (0)