Created
October 15, 2024 10:21
-
-
Save andyantrim/b2a6870ce8e488fa6c711bf15ae757fc to your computer and use it in GitHub Desktop.
rclone python example
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
from rclone_python import rclone, remote_types | |
def create_if_not_exists(): | |
rclone.create_remote( | |
"s3-local", | |
remote_type=remote_types.RemoteTypes.s3, | |
access_key_id="access", | |
secret_access_key="secretkey", | |
region="eu-west-1", | |
endpoint="http://localhost:9000", # Only needed for minio | |
provider="Minio", | |
) | |
print("Created") | |
create_if_not_exists() | |
print(len(remote_types.RemoteTypes)) | |
print(rclone.link("s3-local://test/index.rst", expire="1m")) # Generic should be supported for multiple configs |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment