git annex special remote for Google Drive
Project description
git-annex special remote for GoogleDrive
git-annex-remote-googledrive adds direct and fast support for Google Drive to git-annex and comes with some awesome new features.
Features
- exporttree remotes
- storing the credentials within the repository
- using different Google accounts simultaniously (even within the same repository)
- ... a lot more to come, see Issues
Installation
pip3 install git-annex-remote-googledrive
For Arch Linux, there is a package available in the AUR
Usage
-
Create a git-annex repository (walkthrough)
-
In the repository, run
git-annex-remote-googledrive setup
and follow the instructions to authenticate with your Google account. -
Add a remote for Google Drive. This example:
- Adds a git-annex remote called
google
- Uses 50MiB chunks
- Encrypts all chunks prior to uploading and stores the key within the annex repository
- Stores your files in a folder/prefix called
git-annex
:
- Adds a git-annex remote called
git annex initremote google type=external externaltype=googledrive prefix=git-annex chunk=50MiB encryption=shared mac=HMACSHA512
The initremote command calls out to GPG and can hang if a machine has insufficient entropy. To debug issues, use the --debug
flag, i.e. git-annex initremote --debug
.
Options
Options specific to git-annex-remote-googledrive
prefix
- The path to the folder that will be used for the remote. If it doesn't exist, it will be created.root_id
- Instead of the path, you can specify the ID of a folder. The folder must already exist. This will make it independent from the path and it will always be found by git-annex, no matter where you move it. Can also be used to access shared folders which you haven't added to "My Drive".token
- Path to the file in which the credentials were stored bygit-annex-remote-googledrive setup
. Default: token.jsonkeep_token
- Set toyes
if you would like to keep the token file. Otherwise it's removed during initremote. Default: no
General git-annex options
encryption
- One of "none", "hybrid", "shared", or "pubkey". See encryption.keyid
- Specifies the gpg key to use for encryption.mac
- The MAC algorithm. See encryption.exporttree
- Set toyes
to make this special remote usable by git-annex-export. It will not be usable as a general-purpose special remote.chunk
- Enables chunking when storing large files.
Using an existing remote (note on repository layout)
If you're switching from git-annex-remote-rclone or git-annex-remote-gdrive and already using the nodir
structure,
it's as simple as typing git annex enableremote <remote_name> externaltype=googledrive
. If you were using a different structure, you will be notified to run git-annex-remote-googledrive migrate <prefix>
in order to migrate your remote to a nodir
structure.
If you have a huge remote and the migration takes very long, you can temporarily use the bash based git-annex-remote-gdrive which can access the files during migration. I might add this functionality to this application as well (#25).
I decided not to support other layouts anymore as there is really no reason to have subfolders. Google Drive requires us to traverse the whole path on each file operation, which results in a noticeable performance loss (especially during upload of chunked files). On the other hand, it's perfectly fine to have thousands of files in one Google Drive folder as it doesn't even use a folder structure internally.
Choosing a Chunk Size
Choose your chunk size based on your needs. By using a chunk size below the maximum file size supported by your cloud storage provider for uploads and downloads, you won't need to worry about running into issues with file size. Smaller chunk sizes: leak less information about the size of file size of files in your repository, require less ram, and require less data to be re-transmitted when network connectivity is interrupted. Larger chunks require less round trips to and from your cloud provider and may be faster. Additional discussion about chunk size can be found here and here
Issues, Contributing
If you run into any problems, please check for issues on GitHub. Please submit a pull request or create a new issue for problems or potential improvements.
License
Copyright 2017 Silvio Ankermann. Licensed under the GPLv3.
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
Built Distribution
File details
Details for the file git-annex-remote-googledrive-0.11.1.tar.gz
.
File metadata
- Download URL: git-annex-remote-googledrive-0.11.1.tar.gz
- Upload date:
- Size: 26.9 kB
- Tags: Source
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/1.11.0 pkginfo/1.4.2 requests/2.19.1 setuptools/39.2.0 requests-toolbelt/0.8.0 tqdm/4.23.4 CPython/3.6.6
File hashes
Algorithm | Hash digest | |
---|---|---|
SHA256 | 8d3edcd9cbcf7c7f5617eaacd14f275ed6b5cbafd3e66f4f3a0f75d86b675eed |
|
MD5 | 6fe62b902631f036ac8b2cb7f196841e |
|
BLAKE2b-256 | c5c3965d07a559251edabe5c4d4d0f014eb8188999e33b31f4fc3a17837cbcd4 |
File details
Details for the file git_annex_remote_googledrive-0.11.1-py3-none-any.whl
.
File metadata
- Download URL: git_annex_remote_googledrive-0.11.1-py3-none-any.whl
- Upload date:
- Size: 9.0 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/1.11.0 pkginfo/1.4.2 requests/2.19.1 setuptools/39.2.0 requests-toolbelt/0.8.0 tqdm/4.23.4 CPython/3.6.6
File hashes
Algorithm | Hash digest | |
---|---|---|
SHA256 | 727157440f5ab2d4816e2aab730e8c20bffbb7be226d3f13b9e30834de59a665 |
|
MD5 | a363d8d3a6e27118e58a4cb3a6054618 |
|
BLAKE2b-256 | 019616b9e3532adc1e0e586de87f818294b0af32fe5f4fd60b411fe1b67039f0 |