DOKK / manpages / debian 11 / beancount / upload-to-sheets.1.en
UPLOAD-TO-SHEETS(1) User Commands UPLOAD-TO-SHEETS(1)

upload-to-sheets - publish CSV files to Google Spreadsheet

usage: upload-to-sheets [-h] [--auth_host_name AUTH_HOST_NAME]

[--noauth_local_webserver]
[--auth_host_port [AUTH_HOST_PORT [AUTH_HOST_PORT ...]]] [--logging_level {DEBUG,INFO,WARNING,ERROR,CRITICAL}] [--docid DOCID] [--title DOCTITLE] [--verbose] [--min-rows MIN_ROWS] [filenames [filenames ...]]

Publish a CSV file to a Google Spreadsheet sheet.

This is a convenient script to update an existing Google Spreadsheet document with the contents of a CSV file.

NOTE: This script replaces and obsoletes 'upload-csv-to-google-sheet'.

For example, this invocation creates a new Google Sheet doc and upload the contents of the CSV files to sheets named 'apples' and 'oranges':

upload-to-sheets apples.csv oranges.csv

You can override the name of the sheets created by appending a colon and the name, like this:

upload-to-sheets apples.csv:Apples oranges.csv:Oranges

If you'd like to upload the sheets in an existing document, provide it as an option:

upload-to-sheets --docid="1xcCjHM...j1ubo0Y09DfGn8HRMLY" apples.csv oranges.csv

Note that if you do this and there are existing sheets with the same names, e.g. "apples", the contents of these sheets will be replaced by the uploaded contents. All the other sheets will remain untouched. This is designed so that you can manually craft a custom spreadsheet and upload only some of it sheets with contents derived from another program (e.g. Beancount).

This script only requires the latest and official Google client API libraries (it does not need gdata nor Python wrappers for sheets). It uses the v4 Sheets API (current as of 2013-2017-12-15). You will need to have an installation of the following libraries for this to work:

* google-api-python-client (Google Python client API) * oauth2client * httplib2

Moreover, you will need to enable the Google Sheets API in the developer console and download the Client Secrets that Google provides to ~/.google-apis.json. (You can override this location with the GOOGLE_APIS environment variable.)

CSV filenames[:name] to upload. If 'name' is not provided, infer from the filename.

show this help message and exit
Hostname when running a local web server.
Do not run a local web server.
Port web server should listen on.
Set the logging level of detail.
Spreadsheets doc id to update
Set or update the spreadsheet's title
Print out the log
Minimum number rows to resize uploaded sheet to. This is useful when another sheet feeds from the uploaded one, which otherwise automatically renumbers its references to rows beyond it if they existed, to avoid most such resizing woes.
November 2020 upload-to-sheets 2.3.3