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
- List files in a directory including properties of the files.
- List available remotes.
- Create new remotes
- Check available remotes
Installation 💾
rclone_python can be installed using pip
pip install rclone-python
or by cloning this repository and running from within the root of the project
pip install .
How to use 💡
All functionally of this wrapper is accessible through rclone.
The following example checks if rclone is installed.
from rclone_python import rclone
print(rclone.is_installed())
# True
Create new remote
Create a new rclone remote connection with rclone's default client-id and client-secret.
from rclone_python import rclone
from rclone_python.remote_types import RemoteTypes
rclone.create_remote('onedrive', RemoteTypes.onedrive)
Additionally, client-id and client-secret can be used with many cloud providers.
from rclone_python import rclone
from rclone_python.remote_types import RemoteTypes
rclone.create_remote('onedrive', RemoteTypes.onedrive, client_id='YOUR_CLIENT_ID', client_secret='YOUR_CLIENT_SECRET')
Copy
from rclone_python import rclone
# copy all file in the test_dir on OneDrive to the local data folder.
rclone.copy('onedrive:data', 'data', ignore_existing=True, args=['--create-empty-src-dirs'])
# ☁ Copying: 48%|████▊ | 151.1/315.309 MiB, 13.9 MiB/s, ETA: 11s
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 rclone_python import rclone
# delete a specific file on onedrive
rclone.delete('onedrive:data/video1.mp4')
Prune
from rclone_python 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.1.5
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.1.5.tar.gz | 7.7 kB | Details |
Built distribution (wheel)
| File | Interpreter | ABI | Platform | Reset |
|---|---|---|---|---|
| rclone_python-0.1.5-py3-none-any.whl | Python 3 | none | any | Details |
Total release size: 16.2 kB
Release files / rclone-python-0.1.5.tar.gz
| Download URL | rclone-python-0.1.5.tar.gz |
|---|---|
| Size | 7.7 kB |
| Tags | Source |
|
SHA-256 checksum How to use checksums |
c4bf9e9b91dbd8f3930c92eaec97ab302c0682de9edba79673b445a43ee0e7e6
|
|
BLAKE2b-256 checksum How to use checksums |
384c95a33214d204f4bfde6bcaadb45fb36bc21e70ded62d1a88d00b7743f958
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
twine/4.0.1 CPython/3.11.3
|
Release files / rclone_python-0.1.5-py3-none-any.whl
| Download URL | rclone_python-0.1.5-py3-none-any.whl |
|---|---|
| Size | 8.5 kB |
| Tags | Python 3 |
|
SHA-256 checksum How to use checksums |
4945803e2f3c47588cc6445f7c6312d831d4532eb1cbb5d8f43800ecd32dfc7c
|
|
BLAKE2b-256 checksum How to use checksums |
8597a6a95137e1a4d6a61bb9a8bc19b6e8630e03ad4173f3889bfa815e3211e8
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
twine/4.0.1 CPython/3.11.3
|