# v0.5.x ```python >>> import snapsheets as ss >>> url = "https://docs.google.com/spreadsheets/d/1NbSH0rSCLkElG4UcNVuIhmg5EfjAk3t8TxiBERf6kBM/edit#gid=0" >>> sheet = ss.Sheet(url=url, desc="Get Sample Sheet") >>> sheet.snapshot() 📣 Get Sample Sheet 🤖 Downloaded snapd/snapsheet.xlsx 🚀 Renamed to snapd/20210412T104926_snapsheet.xlsx ``` ## CLI - Added command line interface ```bash $ snapsheets -h usage: snapsheets [-h] [--config CONFIG] [--url URL] [-v] optional arguments: -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 -v, --version show version ``` ### With ``--url`` option - Copy and paste the URL of Google spreadsheet ```bash $ snapsheets --url https://docs.google.com/spreadsheets/d/1NbSH0rSCLkElG4UcNVuIhmg5EfjAk3t8TxiBERf6kBM/edit#gid=0 📣 snapsheet 🤖 Downloaded snapd/snapsheet.xlsx 🚀 Renamed to snapd/20210412T104926_snapsheet.xlsx ``` ### With no argument - Load from configuration file ```bash $ snapsheets ic| 'Loaded TOML files: ', n: 2 ic| 'Loaded TOML files: ', fname: PosixPath('config/gsheet.toml') ic| 'Loaded TOML files: ', fname: PosixPath('config/snapsheets.toml') ic| 'Add sheet', name: 'toml_sample1' ic| 'Add sheet', name: 'toml_sample2' 📣 Example for Snapshot module (in TOML) 🤖 Downloaded snapd/snapsheet.xlsx 🚀 Renamed to snapd/2021_toml_sample1.xlsx 📣 20210304_storage_comparison 🤖 Downloaded snapd/snapsheet.xlsx 🚀 Renamed to snapd/20210412_toml_sample2.xlsx ``` ### Show version ```bash $ snapsheets -v 0.5.1 ``` ## Configuration Files - Make ``./config/`` directory and place your config files (TOML/YAML) - If ``confd`` does not exist, it will search config files in ``. (current directory)`` - You can change ``confd`` directory ### Supported Format #. ``TOML`` #. ``YAML`` - Don't mix two formats - ``TOML`` overrides ``YAML`` settings ### Sections - ``volumes`` - ``saved`` : where to put download files - ``logd`` : where to put logs - ``logf`` : name of logfile - ``options`` - ``wget`` : ``--quiet`` - ``datefmt`` - ``sheets`` - ``name`` : downloaded filename (without extensions) - ``desc`` : description for you not to forget - ``url`` : copy and paste an URL of the Google spreadsheet - ``format`` : select from ``xlsx``, ``ods``, ``csv``, ``tsv`` - ``datefmt`` : used as prefix of downloaded filename - ``skip`` : set true if you wanna skip downloading (default: false) ### TOML Examples ```{code-block} toml --- linenos: caption: config/sheet.toml --- [sheets] [sheets.toml_sample1] name = "toml_sample1" desc = "Example for Snapshot module (in TOML)" url = "https://docs.google.com/spreadsheets/d/1NbSH0rSCLkElG4UcNVuIhmg5EfjAk3t8TxiBERf6kBM/edit#gid=01NbSH0rSCLkElG4UcNVuIhmg5EfjAk3t8TxiBERf6kBM" format = "xlsx" datefmt = "%Y" [sheets.toml_sample2] name = "toml_sample2" desc = "20210304_storage_comparison" url = "https://docs.google.com/spreadsheets/d/16Sc_UgShNuxMfRnBiFsjmfThE1VfVhJf3jgmxNvFeEI/edit#gid=0" format = "csv" datefmt = "%Y%m%d" ``` ### YAML Examples ```{code-block} yaml --- linenos: caption: config/config.yml --- volumes: snapd: 'snapd/' logd: 'varlogs/' options: wget: '--quiet' datefmt: "%Y%m%dT%H%M%S" ``` ```{code-block} yaml --- linenos: caption: config/sheet.yml --- sheets: yaml_sample1: name: "yaml_sample1" desc: "Example for Snapshot module (in YAML)" url: "https://docs.google.com/spreadsheets/d/1NbSH0rSCLkElG4UcNVuIhmg5EfjAk3t8TxiBERf6kBM/edit#gid=01NbSH0rSCLkElG4UcNVuIhmg5EfjAk3t8TxiBERf6kBM" format: "xlsx" datefmt: "%Y"