v0.6.0 (in development)
Organizing classes :
SheetandBookAdd
snapsheets-nextcommandChanged items in configuration
Keep
snapsheetscommand (will be deprecated)
CLI
snapsheets
$ snapsheets -h
usage: snapsheets [-h] [--config CONFIG] [--url URL] [--debug] [--version]
options:
-h, --help show this help message and exit
--config CONFIG set config directory (default: ./config/)
--url URL copy and paste an URL of the Google spreadsheet
--debug show more messages
--version show program's version number and exit
snapsheets-next
$ snapsheets-next -h
usage: snapsheets-next [-h] [--config config | --url url] [-o filename] [-d description] [-t format] [--skip] [--debug] [--version]
snapsheets
options:
-h, --help show this help message and exit
--config config set config file or directory
--url url set URL of Google spreadsheet
-o filename set output filename
-d description set description of a spreadsheet
-t format set datetime prefix for backup filename
--skip skip file
--debug show more messages
--version show program's version number and exit
Show version
$ snapsheets --version
0.5.7
$ snapsheets-next --version
0.6.4
Configurations
config.tomlorconfig/*.tomlwill be loaded if you create an instance without any argument.You can change the filename/directory.
Supported Format
#. TOML
#. YAMML
Supported Sections
sheetsurl: copy and paste an URL of the Google spreadsheetfilename: downloaded filenamedesc: description for you not to forgetdatefmt: used as prefix of downloaded filenameskip: set true if you wanna skip downloading (default: false)
config/snapsheets.toml
[tool.snapsheets]
datefmt = "%Y%m%dT%H%M%S"
[tool.snapsheets.volumes]
saved = "./snapd/"
logd = "./varlogs/"
logf = "snapsheets.log"
[tool.snapsheets.options]
wget = "--quiet"
config/gsheet.toml
[sheets]
[sheets.toml_sample1]
name = "toml_sample1"
desc = "Sample1 : A spreadsheet for snapsheets (in TOML)"
url = "https://docs.google.com/spreadsheets/d/1NbSH0rSCLkElG4UcNVuIhmg5EfjAk3t8TxiBERf6kBM/edit#gid=0"
format = "xlsx"
datefmt = "%Y"
skip = false
[sheets.toml_sample2]
name = "toml_sample2"
desc = "Sample2 : A spreadsheet for snapsheets (in TOML)"
url = "https://docs.google.com/spreadsheets/d/16Sc_UgShNuxMfRnBiFsjmfThE1VfVhJf3jgmxNvFeEI/edit#gid=2015536778"
format = "csv"
datefmt = "%Y%m%d"
skip = true
[sheets.toml_sample3]
name = "toml_sample3"
desc = "Sample3: A spreadsheet for snapsheets (in TOML)"
url = "https://docs.google.com/spreadsheets/d/16Sc_UgShNuxMfRnBiFsjmfThE1VfVhJf3jgmxNvFeEI/edit#gid=2015536778"
format = "csv"
datefmt = "%Y%m%d"
skip = false
TOML Examples
sandbox/next.toml
1[[sheets]]
2url = "https://docs.google.com/spreadsheets/d/1NbSH0rSCLkElG4UcNVuIhmg5EfjAk3t8TxiBERf6kBM/edit#gid=01NbSH0rSCLkElG4UcNVuIhmg5EfjAk3t8TxiBERf6kBM"
3filename = "test_data/toml_sample1.xlsx"
4description = "Example for Snapshot module (in TOML)"
5datefmt = "%Y"
6skip = false
7
8[[sheets]]
9url = "https://docs.google.com/spreadsheets/d/16Sc_UgShNuxMfRnBiFsjmfThE1VfVhJf3jgmxNvFeEI/edit#gid=0"
10filename = "snapd/toml_sample2.csv"
11desc = "20210304_storage_comparison"
12datefmt = "%Y%m%d"
13skip = false
YAML Examples
sandbox/next.yaml
1sheets:
2 - url: "https://docs.google.com/spreadsheets/d/1NbSH0rSCLkElG4UcNVuIhmg5EfjAk3t8TxiBERf6kBM/edit#gid=01NbSH0rSCLkElG4UcNVuIhmg5EfjAk3t8TxiBERf6kBM"
3 filename: "test_data/toml_sample1.xlsx"
4 description: "Example for Snapshot module (in TOML)"
5 datefmt: "%Y"
6 skip: false
7 - url: "https://docs.google.com/spreadsheets/d/16Sc_UgShNuxMfRnBiFsjmfThE1VfVhJf3jgmxNvFeEI/edit#gid=0"
8 filename: "snapd/toml_sample2.csv"
9 desc: "20210304_storage_comparison"
10 datefmt: "%Y%m%d"
11 skip: false