Skip to content
This repository was archived by the owner on Feb 20, 2020. It is now read-only.

aftertheflood/exprecsv

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

21 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

DON'T USE THIS.

This has not been and will not be updated to work with the current version of google spredsheets API

ExpreCSV

An awkwardly titled server for accessing CSVs (and a few other things) from Google spreadsheets written in NodeJS and based on Express

Motivation

I wanted a way to quickly prototype data driven applications without needing to spend too much time upfront modeling data.

Routes

Once the app is up and running and ha access to some google sheets then the following routes exists.

[DOMAIN]/data/:sheetId.json A summary of available sheets for a given Google doc specified by :sheetId

[DOMAIN]/data/:sheetId/:worksheetTitle.csv A CSV of the worksheet called :worksheetTitle from the doc specified by :sheetId

[DOMAIN]/data/:sheetId/:worksheetTitle.csv See above, but JSON

[DOMAIN]/data/:sheetId/dictionary/:worksheetTitle-by-:key.json A JSON object where the property defined by :key can be used to look up records

[DOMAIN]/data/:sheetId/find/:key=:value-in-:worksheetTitle.json A JSON array of rows in the worksheet where the :key column is equal to a specified :value can be used for simple filtering


Google sheet restrictions

Column names in the spreadsheets can't be id

Google-spreadsheet authentiction

https://github.com/theoephraim/node-google-spreadsheet

If you are using Heroku or another environment where you cannot save a local file, you may just pass in an object with

client_email -- your service account's email address private_key -- the private key found in the JSON file

Internally, this uses a JWT client to generate a new auth token for your service account that is valid for 1 hour. The token will be automatically regenerated when it expires.

SPECIAL NOTE FOR HEROKU USERS

Save your private key to a text file Replace \n with actual line breaks Replace \u003d with = heroku config:add GOOGLE_PRIVATE_KEY="$(cat yourfile.txt)"

About

An Express app for exposing google spreadsheets data via an API.

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published