Google-Driver
The Google-Driver Python package simplifies downloading files and folders from Google Drive, with some constraints for model management through Hugging-Face and Git-Lfs. Issues may arise due to too many files, access permissions, or large file sizes. Be cautious with large files as they may contain viruses. The gdown package offers better exception handling and compatibility.
Installation
pip install googledriver
Features
1. File Download
Download to specific path
To save a file from a shared Google Drive URL to local storage, use the following code.
from googledriver import download
URL = 'https://drive.google.com/file/d/xxxxxxxxx/view?usp=share_link'
download(URL, './model/tf_gpt2_model')
Download to cached folder
To download a cached file (or directory) from a URL and return its path, you can use the following method.
from googledriver import download
URL = 'https://drive.google.com/file/d/xxxxxxxxx/view?usp=share_link'
cached_path = download(URL, None, 'tf_model')
Basically, torch cached is used, and the huggingface hub module is used as a reference and wrapped.
2. Folder Download
The return value returns the path of the saved files. However, it is different when using it as a cache folder.
Download to current working directory
from googledriver import download_folder
URL = 'https://drive.google.com/file/d/xxxxxxxxx/view?usp=share_link'
download_folder(URL)
Download to specific directory
from googledriver import download_folder
URL = 'https://drive.google.com/file/d/xxxxxxxxx/view?usp=share_link'
save_folder = './any/path/to/save/'
download_folder(URL, save_folder)
Download to cached directory
from googledriver import download_folder
URL = 'https://drive.google.com/file/d/xxxxxxxxx/view?usp=share_link'
download_folder(URL, cached=True)
In the case of the cache folder, the return value is the cache folder path of Google Drive. Therefore, it may be difficult to cache and use multiple folders.
References
[1] https://github.com/huggingface/transformers
[2] https://github.com/wkentaro/gdown
Metadata
Release files for googledriver 0.1.7
For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.
Source distribution (sdist)
| File | Size | Uploaded | Provenance | Actions |
|---|---|---|---|---|
| googledriver-0.1.7.tar.gz | 18.8 kB | Without provenance | Details for googledriver-0.1.7.tar.gz |
Built distribution (wheel)
| File | Interpreter | ABI | Platform | Actions Reset |
|---|---|---|---|---|
| googledriver-0.1.7-py3-none-any.whl | Python 3 | none | any | Details for googledriver-0.1.7-py3-none-any.whl |
Total release size: 39.7 kB
Release files / googledriver-0.1.7.tar.gz
| Download URL | googledriver-0.1.7.tar.gz |
|---|---|
| Size | 18.8 kB |
| Tags | Source |
|
SHA-256 checksum How to use checksums |
05faa5c06ad6220696dc1b4ca71dd0938dd6eb107bf2c096d449b580e67b0401
|
|
BLAKE2b-256 checksum How to use checksums |
472d8069147171acdd2deb2f4904492abb1a95497796c34f6bb63c4ddbb5b40f
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
twine/3.8.0 pkginfo/1.9.6 readme-renderer/34.0 requests/2.25.1 requests-toolbelt/0.10.1 urllib3/1.26.4 tqdm/4.64.1 importlib-metadata/4.6.4 keyring/23.4.1 rfc3986/1.5.0 colorama/0.4.4 CPython/3.6.7
|
Release files / googledriver-0.1.7-py3-none-any.whl
| Download URL | googledriver-0.1.7-py3-none-any.whl |
|---|---|
| Size | 20.9 kB |
| Tags | Python 3 |
|
SHA-256 checksum How to use checksums |
5f9ebd4ea42ec21148a68a4e890314219917f90f3879f47226793a8ef1764e47
|
|
BLAKE2b-256 checksum How to use checksums |
e17584f28695a9bda28624f84933bf44006df143b834ac1e60a16143caaa1a83
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
twine/3.8.0 pkginfo/1.9.6 readme-renderer/34.0 requests/2.25.1 requests-toolbelt/0.10.1 urllib3/1.26.4 tqdm/4.64.1 importlib-metadata/4.6.4 keyring/23.4.1 rfc3986/1.5.0 colorama/0.4.4 CPython/3.6.7
|
Security for googledriver 0.1.7
Provenance
Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.
No provenance found
None of the files in this release were uploaded with provenance metadata.
A note on package security
PyPI is a repository for distributing packages, not a service for auditing them. While third-party security researchers and our staff do their best to detect and remove malicious packages, PyPI cannot guarantee the quality, security or suitability of any given package.
To learn more about protecting yourself from malicious actors, visit our package security documentation.