rclone-python
A python wrapper for rclone that makes rclone's functionality usable in python. rclone needs to be installed on the system for the wrapper to work.
Features
- Copy and move files between remotes
- Delete and prune files/directories
- Create new remotes
- Check available remotes
Demo
Create new remote
Create a new rclone remote connection with rclone's default client-id and client-secret.
from py_rclone import rclone
from py_rclone.remote_types import RemoteTypes
rclone.create_remote('onedrive', RemoteTypes.onedrive)
Additionally, client-id and client-secret can be used with many ckoud providers.
from py_rclone import rclone
from py_rclone.remote_types import RemoteTypes
rclone.create_remote('onedrive', RemoteTypes.onedrive, client_id='YOUR_CLIENT_ID', client_secret='YOUR_CLIENT_SECRET')
Copy
from py_rclone import rclone
# copy all file in the test_dir on OneDrive to the local data folder.
rclone.copy('onedrive:test_dir', 'data')
Copying from onedrive:test_dir to data |████████████████████████████████████████| 100% in 18.0s (5.56%/s)
Delete
Delete a file or a directory. When deleting a directory, only the files in the directory (and all it's subdirectories) are deleted, but the folders remain.
from py_rclone import rclone
# delete a specific file on onedrive
rclone.delete('onedrive:data/video1.mp4')
Prune
from py_rclone import rclone
# remove the entire test_dir folder (and all files contained in it and it's subdirectories) on onedrive
rclone.purge('onedrive:test_dir')
Metadata
Release files for rclone-python 0.0.2
For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.
Source distribution (sdist)
| File | Size | Uploaded | |
|---|---|---|---|
| rclone-python-0.0.2.tar.gz | 4.6 kB | Details |
Release files / rclone-python-0.0.2.tar.gz
| Download URL | rclone-python-0.0.2.tar.gz |
|---|---|
| Size | 4.6 kB |
| Tags | Source |
|
SHA-256 checksum How to use checksums |
c1159e95f8150cbd73f405ac024272d2de16973051cb71794180ad09a06181ea
|
|
BLAKE2b-256 checksum How to use checksums |
e367042f2b48c5e99d748bffe8f8b08e61a5003328872ce5d216198839d24016
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
twine/4.0.1 CPython/3.10.4
|