

GitHub - kren1/tosheets: Send your stdin to google sheets
source link: https://github.com/kren1/tosheets
Go to the source link to view the article. You can view the picture content, updated content and better typesetting reading experience. If the link is broken, please click the button below to view the snapshot at that time.

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:
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.
-i CSV Read this CSV instead of stdin
-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.
--open Open a browser with the newly created sheet
Distribution
python setup.py sdist bdist_wheel
twine upload dist/*
Recommend
-
50
In this post I want to discuss faking (or redirecting ) standard input and output ( os.Stdin and os.Stdout ) in Go programs. This is often done in tests, but may also be useful in other scenarios. ...
-
21
2019-02-10IntroductionWhen I wrote my last two tools multicode and epoch, I wanted them to work with...
-
28
Read a file (stdin) line by line yourbasic.org/golang Read from file Use a
-
29
Introduction Among the popular operating systems, they have all standardized on using standard input, standard output, and standard error with file desciptors 0, 1, and 2 respectively. This allows you to pipe the inputs and outputs...
-
27
Introduction Operating systems recognize a couple special file descriptor IDs: STDIN - 0 - Input usally coming in from keyboard. STDOUT - 1 - Output from the...
-
19
让ssh从stdin读取密码 执行像ssh,scp这类secure command时,必须手工输入密码,而且它们是直接从/dev/tty而不是stdin中读取密码的,这也意味着无法通过重定向IO的方式传送密码給这些程序. 查了一下网上一般的解决方案是借助 paramiko
-
11
How can I read a single line from stdin? Join Stack Overflow to learn, share knowledge, and build your career.
-
21
Eclipse reading stdin (System.in) from a file advertisements Is it possible for Eclipse to read stdin from a file? Pure Ja...
-
14
Copy link Contributor Patrick-Poitras ...
-
5
Send SleuthBulk validate emails in Google Sheets
About Joyk
Aggregate valuable and interesting links.
Joyk means Joy of geeK