cristoper / gsheet Goto Github PK
View Code? Open in Web Editor NEWgsheet is a CLI tool (and Golang package) for piping csv data to and from Google Sheets
License: MIT License
gsheet is a CLI tool (and Golang package) for piping csv data to and from Google Sheets
License: MIT License
Not necessarily an issue with gsheet, but I'm struggling to find where the problem lies.
I'm trying to simply read a Google Sheet to stdout with the following simple shell script:
#!/bin/bash
export GOOGLE_APPLICATION_CREDENTIALS="/root/.config/gsheet/gsheet.json"
/usr/local/bin/gsheet csv --id "###########' --range 'Test Sheet' > /tmp/test.csv
This works fine when run from the command-line - i.e. I get the contents of my 'Test Sheet' in my test.csv file. When I run this same script from cron, I find 'Updated 0 cells' in my test.csv file.
This, to me, suggests that the gsheet command has run, but it thinks it's getting stdin so tries to update the Google sheet instead. I've tried all sorts of variations of the command, script and how I call it from cron with no luck. Is there any way to force gsheet to pipe the Google sheet contents to stdout, rather than the other way round? Or any other suggestions?
NOTE: This is on a Centos 7 machine, running bash 4.2.46, with gsheet v0.1.1
Sorry for off-topic, but:
Thanks,
Vitaly
Is it possible to add an option to append CSV data to an existing sheet, rather than overwriting? This would make the tool much more usable. Thanks!
We should add path option for auth as it will make it more reusable
but keep the service account approach currently used ?
This tool is very helpful. I want to automate a task by a URL like this:
https://docs.google.com/spreadsheets/d/{spreadsheetId}/edit#gid={sheetId}
^^^^^^^^^^^^^ ^^^^^^^
Then I'll export this sheet to csv:
$ gsheet info spreadsheetId
{
"sheets": [...]
}
# find title by sheetId
$ jq '...'
$ gsheet csv --id spreadsheetId --range 'sheetTitle'
Thanks!
Ref:
A declarative, efficient, and flexible JavaScript library for building user interfaces.
๐ Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. ๐๐๐
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google โค๏ธ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.