Introduction
CSV (or Google Sheets) is an easy to used data format. But it is quite unpredictable, and not that flexible. We aim to help you with "Sheethuahua", a set of schemas, transformers, type-safe parsers and formatters. What you need to do is:
- Define the output schema and how each column is mapped and transformed
- Use the parser or formatter function to validate and transform CSV to JavaScript data and vice versa.
Using TypeBox, d3-dsv, Web Fetch API (and Tempo for date transformer) under the hood, Sheethuahua should be supported by every modern browsers and back-end runtime.
Notes for Google Sheets
Google Sheets has a great potential of being an API read-only database with a user-friendly interface for content editor. But it has a very low rate limit. It should be used with Static Site Generation (SSG), cache, or both.
WeVis's Parliament Watch use Google Sheets as a database with SSG.