Python wrapper for rclone
Project description
Rclone for Python
๐ Python wrapper for rclone.
Requirements
- ๐ Python>=3.6
โฌ๏ธ Installation
pip install rclone
โจ๏ธ Usage
from rclone.rclone import Rclone
rc = Rclone()
๐ Examples
pathname = 'gdrive:/remote/path' # you can also use a local path
rc.copy('foo.txt', 'remote:/path/to/dst')
# 100%|โโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโ| 0.16/0.16 [00:00<00:00, 1.13MB/s]
rc.move('bar.bin', 'remote:/path/to/dst')
# 100%|โโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโ| 0.16/0.16 [00:00<00:00, 1.34MB/s]
rc.unit = 'B'
rc.copy('foo.txt', 'remote:/path/to/dst')
# 100%|โโโโโโโโโโโโโโโโโโโโโโโโโโโ| 159414.0/159414.0 [00:00<00:00, 1003822.00B/s]
rclone.ls('remote:/path/to/dir')
# ['foo.bin', 'bar.txt', 'foo/']
rclone.lsjson('remote:/path/to/dir')
# [
# {
# 'Path': 'bar.txt',
# 'Name': 'bar.txt',
# 'Size': 0,
# 'MimeType': 'text/plain; charset=utf-8',
# 'ModTime': '2022-03-22T13:07:53.557168464-04:00',
# 'IsDir': False
# }
# ]
rclone.ls('remote:/path/to/dir', '-R') # you can supply additional flags to any command as positional argments
# ['foo.bin', 'bar.txt', 'foo/', 'foo/foo1.txt', 'foo/foo2', 'foo/bar/foobar.txt']
rclone.size('remote:/path/to/dir')
# {'total_objects': 5, 'total_size': 170397}
You can also use whatever subcommands/flags with execute()
:
#
rclone.execute('ls "remote:/path/to/dir" --exclude *.txt')
# 27 foo.bin
# 159414 foo.csv.zip
# 4808 rclone.py
Project details
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
rclone-0.4.0.tar.gz
(4.5 kB
view details)
Built Distribution
File details
Details for the file rclone-0.4.0.tar.gz
.
File metadata
- Download URL: rclone-0.4.0.tar.gz
- Upload date:
- Size: 4.5 kB
- Tags: Source
- Uploaded using Trusted Publishing? No
- Uploaded via: poetry/1.1.14 CPython/3.10.5 Darwin/21.5.0
File hashes
Algorithm | Hash digest | |
---|---|---|
SHA256 |
010b1b7f1d20056e807ca5009d365dc709685e5121e16fb54438f26bc092ea27
|
|
MD5 |
3af2f2349b559dd31789f32b22620bdd
|
|
BLAKE2b-256 |
e03b7f61bacc5cbfc70d762d1cc48d999154f5946ae81b4fdda4000fe0a8d448
|
File details
Details for the file rclone-0.4.0-py3-none-any.whl
.
File metadata
- Download URL: rclone-0.4.0-py3-none-any.whl
- Upload date:
- Size: 4.5 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? No
- Uploaded via: poetry/1.1.14 CPython/3.10.5 Darwin/21.5.0
File hashes
Algorithm | Hash digest | |
---|---|---|
SHA256 |
3ff976c44f7cc6e73c61dbbd725125b6e0d56ac94d046d14473620c0f99d9a03
|
|
MD5 |
7458a01d6bf18419f1ee25d898f60e47
|
|
BLAKE2b-256 |
2ce789435c2005181fc76c804ffdc2a14c1cf27518739edf227cc075636882a9
|