Command Line Tool

CLI is also available as of version 0.5.0

オプションは argparse を使ってパースしている。

Without arguments (Book-mode)

  • Load the configuration files and download them in bulk.

  • The default directory for configuration files is . /config/.

  • If the configuration directory does not exist, it will switch to the current directory.

$ snapsheets
ic| msg: 'Directory [varlogs] not found. Set to current directory. [logd = .]'
ic| 'Add sheet', name: 'toml_sample1'
ic| 'Add sheet', name: 'toml_sample2'
📣 Example for Snapshot module (in TOML)
🤖 Downloaded snapd/snapshot.xlsx
🚀 Renamed to snapd/2021_toml_sample1.xlsx
📣 20210304_storage_comparison
🤖 Downloaded snapd/snapshot.xlsx
🚀 Renamed to snapd/20210411_toml_sample2.xlsx


$ snapsheets-next
📣 Example for Snapshot module (in TOML)
🤖 Downloaded snapd/snapshot.csv
🚀 Renamed to snapd/2021_toml_sample1.csv
📣 20210304_storage_comparison
🤖 Downloaded snapd/snapshot.csv
🚀 Renamed to snapd/20210411_toml_sample2.csv

With arguments (Sheet-mode)

  • Copy and paste an URL of the Google Spreadsheet.

  • Downloaded to current directory.

  • The default file name is Date&Time_snapshot.xlsx.

$ snapsheets --url URL
ic| msg: 'Directory [varlogs] not found. Set to current directory. [logd = .]'
📣 None
🤖 Downloaded snapd/snapshot.xlsx
🚀 Renamed to snapd/20210411T233645_snapshot.xlsx

$ snapsheets-next --url URL
📣 Add description here.
🤖 Downloaded snapshot.csv
🚀 Renamed to 20210411_snapshot.csv

Settings in poetry

  • Added lines below to pyproject.toml

[tool.poetry.scripts]
snapsheets = "snapsheets.core:cli"
snapsheets-next = "snapsheets.next:cli"