Git Product home page Git Product logo

tosheets's Introduction

A simple command line utility that sends your stdin to sheets.

Available on pip by pip install tosheets (python3+ only)

NOTE: On first use, tosheets will open a browser window to authorize OAuth2 token.

Using tosheets

Pipe a local file to a new spreadsheet.

cat data.csv | tosheets -c A1 -d , --new-sheet="tosheetsSheet"

Pipe a local file to an existing spreadsheet: (Given a URL like https://docs.google.com/spreadsheets/d/sample-spread-sheet-id-23sdf32543fs/edit#gid=0)

cat data.csv | tosheets -c B4 -d , --spreadsheet=sample-spread-sheet-id-23sdf32543fs

Send sequence from 1 to 10 to a column starting at B4:

seq 1 10 | tosheets -c B4 --spreadsheet=sample-spread-sheet-id-23sdf32543fs

Send a matrix:

1 2
3 4

To the same location:

echo -e '1 2\n3 4' | tosheets -c B4 --spreadsheet=sample-spread-sheet-id-23sdf32543fs

To sheets has a variety of other options listed:

tosheets, send stdin to your google sheets

Usage:
  tosheets -c <cell> [-u] [-k] [-s <sheet>] [--spreadsheet=<spreadsheet>] [--new-sheet=<name>] [-d <delimiter>] [-q <quote char>]
  tosheets (-h | --help)
  tosheets --version

Options:
  -h --help                     Prints help.
  --version                     Show version.
  -u                            Update CELL(s) instead of appending.
  -k                            Keep fields as they are (do not try to convert int or float).
  -c CELL                       Start appending to CELL.
  -s SHEET                      Use sheet name SHEET, otherwise tries to use
                                TOSHEETS_SHEET (default: first visible sheet).
  -d DELIMITER                  Use DELIMITER to split each line (default: whitespace).
  -q QUOTE_CHAR                 A one-character string used to quote fields containing special characters,
                                such as the delimiter or quotechar, or which contain new-line characters.
                                (default: '"').
  --spreadsheet=<spreadsheet>   Send to the spreadsheet identified by spreadshetId
                                (ie. docs.google.com/spreadsheets/d/<spreadsheetId>/...),
                                if empty uses TOSHEETS_SPREADSHEET enviroment variable.
  --new-sheet=<name>            Create a new spreadsheet with the chosen name. Prints the
                                spreadsheetId so it can be piped/stored.

Distribution

python setup.py sdist bdist_wheel
twine upload dist/*

tosheets's People

Contributors

kren1 avatar avilella avatar andresriancho avatar timwis avatar khoyo avatar

Watchers

James Cloos avatar  avatar

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.