Getting tired of downloading Google Spreadsheets one by one from the browser ?
Project description
Snapsheets
Getting tired of downloading Google Spreadsheets one by one from the browser ?
This package enables to wget Google Spreadsheets without login. (Spreadsheets should be shared with public link)
Usage : as python module
>>> from snapsheets import Sheet
>>> url = "https://docs.google.com/spreadsheets/d/1NbSH0rSCLkElG4UcNVuIhmg5EfjAk3t8TxiBERf6kBM/edit#gid=0"
>>> sheet = Sheet(url=url, desc="Get Sample Sheet")
>>> sheet.snapshot()
📣 Get Sample Sheet
🤖 Downloaded snapd/snapsheet.xlsx
🚀 Renamed to snapd/20220602T225044_snapsheet.xlsx
Usage : as CLI
$ 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
$ snapsheets --url "https://docs.google.com/spreadsheets/d/1NbSH0rSCLkElG4UcNVuIhmg5EfjAk3t8TxiBERf6kBM/edit#gid=0"
📣 snapsheet
🤖 Downloaded snapd/snapsheet.xlsx
🚀 Renamed to snapd/20220602T224856_snapsheet.xlsx
- Use
--url
option to download single spreadsheet. - Downloaded file is temporarily named as
snapsheet.xlsx
, then renamed with current-time based prefix. - (More options might be added later)
Usage : with configuration files
- This is useful when you have lots of files to download.
- Make
./config/
directory and place your TOML/YAML configuration files.- If
./config/
does not exist, it will search from. (current directory)
.
- If
- Downloaded files are saved to
./snapd/
directory- If
./snapd/
does not exit, it will be saved in. (current directory)
. - (Options to switch directory might be added later)
- If
$ snapsheets
📣 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
Next version
- いまのバージョンはデフォルトで設定ファイルを読み込むようになっている
- いま考えるとなんだかよく分からない仕様になっている
- 設定ファイルがない場合は、エラーがでて止まるように変更したい
- ついでに設定ファイルの内容を簡素化しようと考えている
$ snapsheets-next -h
$ snapsheets-next --url "https://docs.google.com/spreadsheets/d/1NbSH0rSCLkElG4UcNVuIhmg5EfjAk3t8TxiBERf6kBM/edit#gid=0"
📣 Add description here.
🤖 Downloaded snapshot.csv
🚀 Renamed snapshot.csv to _snapshot.csv
>>> from snapsheets.next import Sheet
>>> url = https://docs.google.com/spreadsheets/d/1NbSH0rSCLkElG4UcNVuIhmg5EfjAk3t8TxiBERf6kBM/edit#gid=0"
>>> filename = "snapsheet.csv"
>>> description = "Get sample sheet"
>>> sheet = Sheet(url=url, filename=filename, description=description)
>>> sheet.snapshot()
📣 Get sample sheet
🤖 Downloaded snapsheet.csv
🚀 Renamed snapsheet.csv to 20220602_snapsheet.csv
Other requirements
- Install
wget
if your system doesn't have them - Make your spreadsheet available with shared link (OK with read-only)
Documents
PyPI package
Project details
Release history Release notifications | RSS feed
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
snapsheets-0.6.0.tar.gz
(14.7 kB
view hashes)
Built Distribution
snapsheets-0.6.0-py3-none-any.whl
(16.9 kB
view hashes)
Close
Hashes for snapsheets-0.6.0-py3-none-any.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 9e4d2cace1fd91a7b286f15fb247c0046222f07eb5e03fbc619eeb4cfe53418f |
|
MD5 | cd9e6ab9c2c2fbe12e18454461500cd3 |
|
BLAKE2b-256 | f485dc0c2093c644f8653fbaf2f9051cd1946f20fb68c272d0e735e44474a9c0 |