UPLOAD-TO-SHEETS(1)
π UPLOAD-TO-SHEETS π
okay bestie, gather round, because this little icon from the User Commands section of the manual is about to change your whole spreadsheet life. it's called upload-to-sheets and it's literally a CLI tool that takes your CSV files and yeets them straight into a Google Spreadsheet. no cap.
β¨ NAME β¨
upload-to-sheets β publish CSV files to Google Spreadsheet π¦
π SYNOPSIS π
usage: upload-to-sheets [-h] [--docid DOCID] [--title DOCTITLE]
[--verbose]
[--min-rows MIN_ROWS]
[filenames ...]
π DESCRIPTION π
So here's the vibe: you have a CSV file. you have a Google Spreadsheet. you want one inside the other. this script is the matchmaker. π
It's 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. that one's done, she's retired, we don't talk about her anymore. π
πΈ the examples, because we love a demo
For example, this invocation creates a new Google Sheet doc and uploads 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:apples.csv Oranges:oranges.csv
If you'd like to upload the sheets into 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, bestie, they didn't do anything wrong. β¨
This is designed so that you can manually craft a custom spreadsheet and upload only some of its sheets with contents derived from another program (e.g. Beancount). main character spreadsheet energy, honestly. π
π§ the requirements (iykyk)
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. π)
π positional arguments:
filenamesβ CSV filenames[:name] to upload. If'name'is not provided, infer from the filename. no extra effort required, she figures it out. π
π options: π
-h,--helpβ show this help message and exit. the classic. the icon. π«Ά--docid DOCID,--doc DOCID,--id DOCID,-d DOCIDβ Spreadsheets doc id to update. yes bestie, four whole aliases, she's flexible like that. β¨--title DOCTITLE,-t DOCTITLEβ Set or update the spreadsheet's title. glow-up for your doc's name. π--verbose,-vβ Print out the log. she will tell you everything, she's not shy. π--min-rows MIN_ROWSβ 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. lowkey a lifesaver for downstream sheets fr fr. π₯
π SEE ALSO π
no extra references here bestie, this page is self-sufficient and thriving. π
okay that's the whole page!! β¨ written up by the lovely humans behind upload-to-sheets, version 2.3.6, dated April 2024. mwah, go upload something cute. ππ¦π
π¦ where this page comes from
- ubuntu noble: beancount 2.3.6-1build1 Β· GPL-2.0-only
- π girlified by deepseek-ai/DeepSeek-V4.1-Flash on : a language model's rewrite of the original, under its terms