-
Notifications
You must be signed in to change notification settings - Fork 4
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Add back Google Sheets support and remove outdated code (#23)
* refactor: remove outdated functions * feat: add back google sheets support * pkg: remove unneeded dependencies * fix: fix the drive export url * test: update the tests to match new functions * docs: add a docstring for sheet_download_url * docs: update the documentation to the unified download function * docs: remove outdated information in the readme * docs: fix typos in the documentation * pkg: bump version to 0.2.0 * refactor: export a google_download_url function * fix: accept file paths and commands as download locations * docs: remove outdated information from the readme * test: expand test coverage * pkg: add compat entry for Downloads
- Loading branch information
Showing
6 changed files
with
70 additions
and
270 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,17 +1,11 @@ | ||
name = "GoogleDrive" | ||
uuid = "91feb7a0-3508-11ea-1e8e-afea2c1c9a19" | ||
authors = ["tejasvaidhyadev <[email protected]> and contributors"] | ||
version = "0.1.3" | ||
version = "0.2.0" | ||
|
||
[deps] | ||
DataDeps = "124859b0-ceae-595e-8997-d05f6a7a8dfe" | ||
Dates = "ade2ca70-3891-5945-98fb-dc099432e06a" | ||
Downloads = "f43a241f-c20a-4ad4-852c-f6b1247861c6" | ||
HTTP = "cd3eb016-35fb-5094-929b-558a96fad6f3" | ||
Random = "9a3f8284-a2c9-5f02-9a11-845980a1fd5c" | ||
|
||
[compat] | ||
DataDeps = "0.7.10" | ||
Downloads = "1" | ||
HTTP = "1.4.0" | ||
julia = "1.9" | ||
Downloads = "1" |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,52 +1,26 @@ | ||
## functions | ||
|
||
### drive_download | ||
`drive_download(URL, localdir)` | ||
### google_download | ||
|
||
`google_download(URL, IO)` | ||
|
||
Download a file from Google Drive or Google Sheets. | ||
|
||
Download flie from Google drive. | ||
The above function only Download file from google drive. | ||
Downloading CSV file from google_drive using google_download function | ||
#### Example | ||
``` | ||
julia>drive_download("https://drive.google.com/file/d/0B9w48e1rj-MOLVdZRzFfTlNsem8/view") | ||
┌ Info: Downloading | ||
│ source = "https://drive.google.com/file/d/0B9w48e1rj-MOLVdZRzFfTlNsem8/view" | ||
│ dest = "/home/iamtejas/Downloads/InternshipsToApplyFor-Sheet1.csv" | ||
│ progress = NaN | ||
│ time_taken = "0.05 s" | ||
│ time_remaining = "NaN s" | ||
│ average_speed = "84.961 KiB/s" | ||
│ downloaded = "4.163 KiB" | ||
│ remaining = "∞ B" | ||
└ total = "∞ B" | ||
"/home/iamtejas/Downloads/InternshipsToApplyFor-Sheet1.csv" | ||
|
||
Downloading a ZIP file from Drive using the `google_download` function | ||
``` | ||
julia> google_download("https://drive.google.com/file/d/0B9w48e1rj-MOLVdZRzFfTlNsem8/view", "file.zip") | ||
"/home/iamtejas/Downloads/file.zip" | ||
``` | ||
|
||
### sheet_handler | ||
`sheet_handler(long_url)` | ||
|
||
Provide URL that can be use as link for registering in Datadeps | ||
### google_download_url | ||
|
||
### google_download | ||
`google_download(URL, localdir)` | ||
Convert a direct Google Drive / Google Sheets URL to the direct download form. | ||
|
||
It can also be consider as "maybe google download function" | ||
The function can be used to download file from google-drive,google-sheets or HTTP download method | ||
#### Example | ||
``` | ||
julia>google_download("https://docs.google.com/spreadsheets/d/1tbNIGxnp8wLk31DIMNPD_Hi_CmIdpdTPfzMUDcs1xE/edit#gid=0","/home/iamtejas/Downloads") | ||
┌ Info: Downloading | ||
│ source = "https://docs.google.com/spreadsheets/d/1tbNI-Gxnp8wLk31DIMNPD_Hi_CmIdpdTPfzMUDcs1xE/export?format=csv" | ||
│ dest = "/home/iamtejas/Downloads/InternshipsToApplyFor-Sheet1.csv" | ||
│ progress = NaN | ||
│ time_taken = "0.05 s" | ||
│ time_remaining = "NaN s" | ||
│ average_speed = "84.961 KiB/s" | ||
│ downloaded = "4.163 KiB" | ||
│ remaining = "∞ B" | ||
└ total = "∞ B" | ||
"/home/iamtejas/Downloads/InternshipsToApplyFor-Sheet1.csv" | ||
|
||
``` | ||
julia> google_download_url("https://drive.google.com/file/d/0B9w48e1rj-MOLVdZRzFfTlNsem8/view") | ||
"https://docs.google.com/uc?export=download&id=0B9w48e1rj-MOLVdZRzFfTlNsem8" | ||
``` |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.
033063a
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@JuliaRegistrator() register
033063a
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Registration pull request created: JuliaRegistries/General/96879
Tip: Release Notes
Did you know you can add release notes too? Just add markdown formatted text underneath the comment after the text
"Release notes:" and it will be added to the registry PR, and if TagBot is installed it will also be added to the
release that TagBot creates. i.e.
To add them here just re-invoke and the PR will be updated.
Tagging
After the above pull request is merged, it is recommended that a tag is created on this repository for the registered package version.
This will be done automatically if the Julia TagBot GitHub Action is installed, or can be done manually through the github interface, or via: