commit message from python script

This commit is contained in:
2024-01-29 11:55:11 +01:00
parent 7a312b38b5
commit d5effaa3e2
2467 changed files with 431949 additions and 0 deletions

View File

@@ -0,0 +1,21 @@
MIT License
Copyright (c) 2022 Johannes Gundlach
Permission is hereby granted, free of charge, to any person obtaining a copy
of this software and associated documentation files (the "Software"), to deal
in the Software without restriction, including without limitation the rights
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
copies of the Software, and to permit persons to whom the Software is
furnished to do so, subject to the following conditions:
The above copyright notice and this permission notice shall be included in all
copies or substantial portions of the Software.
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
SOFTWARE.

View File

@@ -0,0 +1,141 @@
Metadata-Version: 2.1
Name: rclone-python
Version: 0.1.12
Summary: A python wrapper for rclone.
Home-page: https://github.com/Johannes11833/rclone_python
Author: Johannes Gundlach
Keywords: rclone,wrapper,cloud sync
Classifier: Programming Language :: Python :: 3
Classifier: License :: OSI Approved :: MIT License
Classifier: Operating System :: OS Independent
Requires-Python: >=3.6
Description-Content-Type: text/markdown
License-File: LICENSE
Requires-Dist: rich
[![MIT License](https://img.shields.io/badge/License-MIT-green.svg)](https://choosealicense.com/licenses/mit/)
[![PyPI version](https://badge.fury.io/py/rclone-python.svg)](https://badge.fury.io/py/rclone-python)
# 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](https://raw.githubusercontent.com/Johannes11833/rclone_python/master/demo/demo.gif)
## Features ⚒️
- Copy, move and sync files between remotes
- Delete and prune files/directories
- List files in a directory including properties of the files.
- List available remotes.
- Generate hashes from files or validate them with their hashsum.
- Create new remotes
- Check available remotes
- Create and manage public links.
- Check the currently installed rclone versions and if updates are available.
## Installation 💾
_rclone_python_ can be installed using pip
```shell
pip install rclone-python
```
or by cloning this repository and running from within the root of the project
```shell
pip install .
```
## How to use 💡
All functionally of this wrapper is accessible through `rclone`.
The following example checks if rclone is installed.
```python
from rclone_python import rclone
print(rclone.is_installed())
```
```console
True
```
### Create new remote
Create a new rclone remote connection with rclone's default client-id and client-secret.
```python
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.
```python
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
```python
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'])
```
```console
Copying onedrive:data to data ⠸ ━━━━━━━━━━━━━━━━━━╸━━━━━━━━━━━━━━━━━━━━━ 47% 110.0/236.5 MiB 0:00:04
├─video1.webm ⠸ ━━━━━━━━━━━━╺━━━━━━━━━━━━━━━━━━━━━━━━━━━ 31% 24.4/78.8 MiB 0:00:06
├─video2.webm ⠸ ━━━━━━━━━━━━━━━━━━╺━━━━━━━━━━━━━━━━━━━━━ 45% 35.5/78.8 MiB 0:00:03
└─video3.webm ⠸ ━━━━━━━━━━━━━╸━━━━━━━━━━━━━━━━━━━━━━━━━━ 35% 27.6/78.8 MiB 0:00:05
```
### 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.
```python
from rclone_python import rclone
# delete a specific file on onedrive
rclone.delete('onedrive:data/video1.mp4')
```
### Prune
```python
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')
```
### Get Hash
```python
from rclone_python import rclone
from rclone_python.hash_types import HashTypes
print(rclone.hash(HashTypes.sha1, "box:data")
```
```console
{'video1.webm': '3ef08d895f25e8b7d84d3a1ac58f8f302e33058b', 'video3.webm': '3ef08d895f25e8b7d84d3a1ac58f8f302e33058b', 'video2.webm': '3ef08d895f25e8b7d84d3a1ac58f8f302e33058b'}
```
## Debug
For debugging progress related functionality, set the DEBUG flag to true:
```python
rclone.DEBUG = True
```
This will make the wrapper print the raw rclone progress.

View File

@@ -0,0 +1,17 @@
rclone_python-0.1.12.dist-info/INSTALLER,sha256=zuuue4knoyJ-UwPPXg8fezS7VCrXJQrAP7zeNuwvFQg,4
rclone_python-0.1.12.dist-info/LICENSE,sha256=h8fr4UVXKFpLJXJGFs1dZ1aNTn681nrwxIpEITYutbo,1074
rclone_python-0.1.12.dist-info/METADATA,sha256=d2A68MLophBe2xLGq2BToXgZGbg87Si4wxQCgzRhg4U,4395
rclone_python-0.1.12.dist-info/RECORD,,
rclone_python-0.1.12.dist-info/REQUESTED,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
rclone_python-0.1.12.dist-info/WHEEL,sha256=yQN5g4mg4AybRjkgi-9yy4iQEFibGQmlz78Pik5Or-A,92
rclone_python-0.1.12.dist-info/top_level.txt,sha256=KXEB0--B84-7O6qybwQKoU-_XBQ9f6fD17QwPtX0RFs,14
rclone_python/__init__.py,sha256=X3J9304PBLJ6R-wpcwP3ozcXPbjz_z8dBOeUAG5u9Ck,19
rclone_python/__pycache__/__init__.cpython-311.pyc,,
rclone_python/__pycache__/hash_types.cpython-311.pyc,,
rclone_python/__pycache__/rclone.cpython-311.pyc,,
rclone_python/__pycache__/remote_types.cpython-311.pyc,,
rclone_python/__pycache__/utils.cpython-311.pyc,,
rclone_python/hash_types.py,sha256=Lxcw3t5goiUmPj2BZTXzRLM73z0T2-3stkQ0BdUiHSY,433
rclone_python/rclone.py,sha256=MPMM3C50Xd9Naf8zY5iQxJZLv1kOIKpvK6gydw5-l40,19954
rclone_python/remote_types.py,sha256=eYJoJxUcI0ZjW3nOonUItzNV-M1zfroITduXKIlxqJA,1522
rclone_python/utils.py,sha256=SibRDJx68d1iWW5hqWUaHE3L5Io1p19n8YoymPUrGYw,8936

View File

@@ -0,0 +1,5 @@
Wheel-Version: 1.0
Generator: bdist_wheel (0.41.2)
Root-Is-Purelib: true
Tag: py3-none-any

View File

@@ -0,0 +1 @@
rclone_python