Skip to main content

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.
  -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/*

Metadata

Release files for tosheets 0.4.2

For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.

Source distribution (sdist)

Source distribution for tosheets 0.4.2
File Size Uploaded
tosheets-0.4.2.tar.gz 4.8 kB Details

Built distribution (wheel)

Table of built distributions (wheels) for tosheets 0.4.2
File Interpreter ABI Platform
tosheets-0.4.2-py3-none-any.whl Python 3 none any Details

Total release size: 11.4 kB

Release files / tosheets-0.4.2.tar.gz

Download URL tosheets-0.4.2.tar.gz
Size 4.8 kB
Tags Source
SHA-256 checksum
How to use checksums
4bbe615dfc1ea3974417f14cf6a36ab8d20311abf75991fbad9aa2e8825a1d4b
BLAKE2b-256 checksum
How to use checksums
2e7de82e61664868b6062b9b92f9333cf569a5fe6bfb9764a2f0bd74940d6e26
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/1.14.0 pkginfo/1.4.2 requests/2.18.4 setuptools/41.2.0 requests-toolbelt/0.8.0 tqdm/4.23.4 CPython/3.5.2

Release files / tosheets-0.4.2-py3-none-any.whl

Download URL tosheets-0.4.2-py3-none-any.whl
Size 6.6 kB
Tags Python 3
SHA-256 checksum
How to use checksums
452bd203f688003b327e96c23a67de00db4e39d1886351b2cd95bd53cf599f3f
BLAKE2b-256 checksum
How to use checksums
b5e3c92757a0a38126bb5b7245b3db2c1039b1f7eef73e77c8d05864ab8b2726
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/1.14.0 pkginfo/1.4.2 requests/2.18.4 setuptools/41.2.0 requests-toolbelt/0.8.0 tqdm/4.23.4 CPython/3.5.2

Release history Release notifications | RSS feed

This release

0.4.2 This release

2 release files

0.4.1

2 release files

0.4.0

2 release files

0.3.1

2 release files

0.3.0

2 release files

0.2.0

2 release files

0.1.8

2 release files

Anthropic, PBC Visionary sponsor Bloomberg Visionary sponsor Hudson River Trading Visionary sponsor Meta Visionary sponsor NVIDIA Visionary sponsor Microsoft Sustainability sponsor Depot Continuous Integration AWS Cloud computing and Security Sponsor Datadog Monitoring Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page