Skip to main content

MIT License PyPI version

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.

demo gif

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.1

For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.

Source distribution (sdist)

Source distribution for rclone-python 0.1.1
File Size Uploaded
rclone-python-0.1.1.tar.gz 6.4 kB Details

Built distribution (wheel)

Table of built distributions (wheels) for rclone-python 0.1.1
File Interpreter ABI Platform
rclone_python-0.1.1-py3-none-any.whl Python 3 none any Details

Total release size: 13.8 kB

Release files / rclone-python-0.1.1.tar.gz

Download URL rclone-python-0.1.1.tar.gz
Size 6.4 kB
Tags Source
SHA-256 checksum
How to use checksums
791aa21d95fc42df91bb0ed35a1cb8011262ab38e1669d5c902bed486c95015b
BLAKE2b-256 checksum
How to use checksums
d57e40d4108028078f20f25ecfc6fdc3fe38d0d31a8c5873d74cf06f80c846dc
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/4.0.1 CPython/3.9.13

Release files / rclone_python-0.1.1-py3-none-any.whl

Download URL rclone_python-0.1.1-py3-none-any.whl
Size 7.3 kB
Tags Python 3
SHA-256 checksum
How to use checksums
9fd5ae7cd30ae25a649d894dcaeb3161bc86ddb78c097f93c2cf11fa02dcab79
BLAKE2b-256 checksum
How to use checksums
50c34fc8cd01f9e8fefcbff6cef724d9ac5aa9221f71b8ffad5734f65f741e9b
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/4.0.1 CPython/3.9.13

Release history Release notifications | RSS feed

0.1.25

2 release files

0.1.24

2 release files

0.1.23

2 release files

0.1.21

2 release files

0.1.18

2 release files

0.1.17

2 release files

0.1.16

2 release files

0.1.15

2 release files

0.1.14

2 release files

0.1.13

2 release files

0.1.12

2 release files

0.1.11

2 release files

0.1.10

2 release files

0.1.9

2 release files

0.1.8

2 release files

0.1.7

2 release files

0.1.6

2 release files

0.1.5

2 release files

0.1.4

2 release files

0.1.3

2 release files

0.1.2

2 release files

This release

0.1.1 This release

2 release files

0.1.0

2 release files

0.0.9

2 release files

0.0.8

2 release files

0.0.7

2 release files

0.0.6

1 release file

0.0.5

1 release file

0.0.4

1 release file

0.0.3

1 release file

0.0.2

1 release file

0.0.1

1 release file

Anthropic, PBC Visionary sponsor Bloomberg Visionary sponsor Hudson River Trading Visionary sponsor Meta Visionary sponsor NVIDIA Visionary sponsor Microsoft Sustainability sponsor Depot Continuous Integration AWS Cloud computing and Security Sponsor Datadog Monitoring Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page