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
>>> import snapsheets as ss
>>> sample_url1 = "https://docs.google.com/spreadsheets/d/1NbSH0rSCLkElG4UcNVuIhmg5EfjAk3t8TxiBERf6kBM/edit#gid=0"
>>> sheet = ss.Sheet(url=sample_url1, desc="Get Sample Sheet")
>>> sheet.snapshot()
📣 Get Sample Sheet
🤖 Downloaded snapd/snapsheet.xlsx
🚀 Renamed to snapd/20210412T104727_snapsheet.xlsx
Usage : as CLI
$ snapsheets --url "https://docs.google.com/spreadsheets/d/1NbSH0rSCLkElG4UcNVuIhmg5EfjAk3t8TxiBERf6kBM/edit#gid=0"
📣 snapsheet
🤖 Downloaded snapd/snapsheet.xlsx
🚀 Renamed to snapd/20210412T104926_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
v0.2.3 or older
- Added DeprecationWarnings
- It still works
>>> print("💥💥💥 deprecated since version 0.2.3 💥💥💥")
>>> fname = "config/config.yml"
>>> ss.config.add_config(fname)
snapsheets/sandbox/snapper.py:28: DeprecationWarning: Call to deprecated function (or staticmethod) add_config. (Will be removed.) -- Deprecated since version 0.2.3.
ss.config.add_config(fname)
>>> fname = "config/gsheet.yml"
>>> ss.config.add_config(fname)
snapsheets/sandbox/snapper.py:30: DeprecationWarning: Call to deprecated function (or staticmethod) add_config. (Will be removed.) -- Deprecated since version 0.2.3.
ss.config.add_config(fname)
>>> fname = ss.gsheet.get("test1", by="wget")
snapsheets/sandbox/snapper.py:31: DeprecationWarning: Call to deprecated function (or staticmethod) get. (Will be removed) -- Deprecated since version 0.3.0.
fname = ss.gsheet.get("test1", by="wget")
2021-04-07 19:44:18 - INFO - gsheet.py - snapsheets.gsheet - download - ダウンロードするよ : test1
2021-04-07 19:44:19 - INFO - gsheet.py - snapsheets.gsheet - download - ダウンロードしたよ : snapd/test_sheet.xlsx
2021-04-07 19:44:19 - INFO - gsheet.py - snapsheets.gsheet - backup - 移動するよ : test_sheet.xlsx
2021-04-07 19:44:19 - INFO - gsheet.py - snapsheets.gsheet - backup - 移動したよ : 2021_test_sheet.xlsx
Preparation
- 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.5.7.tar.gz
(13.0 kB
view hashes)
Built Distribution
snapsheets-0.5.7-py3-none-any.whl
(14.6 kB
view hashes)
Close
Hashes for snapsheets-0.5.7-py3-none-any.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | f839175dbad7f5a6bf8f5b515283fbd7801bddacb4a9f05dc012cfc16c06dbab |
|
MD5 | 8c843a38f0e0f835d9ab3e3d9ea10309 |
|
BLAKE2b-256 | b3b92d53dc31fbef5dfea98e41028692571dc474c773f4a7a2ed46ece7dc6776 |