> [!tldr] Seems obvious? This thought came to me when I was writing about the [[Gap in the Spreadsheet Market]]... [[CSV]]s are eternal, the king of all tabular data formats for longevity. Their strength lay in their complete **lack** of complexity. However, this is also their weakness. It's not always clear what [[Data Types]] a column is using. There's no method of storing metadata about the file or its contents in the file. There have been attempts (with varying degrees of success) to solve this problem, things like the [[Data Package (standard)]] have CSV-dialects. However, as I read on Reddit one time "_your best bet for data longevity is a CSV file with a simple [[Plain Text Durability|plaintext]] file next to it describing the columns_". ...but we've solved this metadata problem in [[Markdown]]. It's called [[Frontmatter]]. Why not have a [[CSV]] file with some [[YAML]] in a block up top? As simple as: ```csvy --- title: Employees description: An example file showing how CSV would lend itself to having Frontmatter date: "2026-03-29" --- id,name,surname,started,years ag123,Aaron,Gillespie,2025-03-29,1 bm123,Bob,Manning,2023-10-22,3 ``` Or slightly more useful: ```csvy --- title: Employees description: An example file showing how CSV would lend itself to having Frontmatter. date: "2026-03-29" fields: - title: id description: Employee ID type: text - title: name description: Employee first name - title: surname description: Employee last name - title: started description: Employee's formal hire date type: ISO8601 - title: years description: Years of service type: integer --- id,name,surname,started,years ag123,Aaron,Gillespie,2025-03-29,1 bm123,Bob,Manning,2023-10-22,3 ``` ## CSVY > [!note] > Turns out this sort of _is_ a thing? They call it `.csvy` - but I've never come across it and dabble in this space often. Looks like this idea **does** exist, it just didn't quite take off? > [!quote] > One topic that I have been thinking about the past two days is how to add metadata to CSV files while keeping the simplicity of the format. This is important for DataCite, as we want to make the process of registering datasets with metadata painless, and for individual researchers and small research groups the process should be as simple as possible. Two groups have done great work in this area and Jeni Tennison and Dan Fowler gave presentations about their work at CSVconf: > > - **Jeni Tennison**: Making CSV part of the web, describing the work of the [CSV on the Web](https://www.w3.org/2013/csvw/wiki/Main_Page) W3C working group > - **Dan Fowler**: Data Packages and Frictionless Data for Research, talking about the work Open Knowledge has done on defining [data packages](https://frictionlessdata.io/data-packages/) > > Both groups use a JSON file to describe the metadata of an associated CSV file. While it is a straightforward process, it still feels as if we are leaving the simplicity of the CSV format. And when we generate a JSON file to describe the metadata, we might as well convert the CSV into JSON and put the metadata into the same file. Martin Fenner (dude who I'm quoting there) even suggests that the `.csvy` could be used as an alternative to [[Extended Markdown Syntax|Markdown Tables]] in [[CommonMark]]. That's a cool idea too. ## Translator Really all I'd need to make is a translator. A layer to convert from other file types to this file type and back. **** # More ## Source - self - a poorly remembered quote from Reddit like a year ago - and I found this! https://blog.front-matter.de/posts/thinking-about-csv/