Code Monkey home page Code Monkey logo

gsheet's Issues

Unable to pipe data from Google Sheet to stdout when running gsheet from crontab

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

Append to sheet

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!

OAuth

We should add path option for auth as it will make it more reusable

but keep the service account approach currently used ?

Please add sheets array to info

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:

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.