Skip to content

Instantly share code, notes, and snippets.

@andyantrim
Created October 15, 2024 10:21
Show Gist options
  • Save andyantrim/b2a6870ce8e488fa6c711bf15ae757fc to your computer and use it in GitHub Desktop.
Save andyantrim/b2a6870ce8e488fa6c711bf15ae757fc to your computer and use it in GitHub Desktop.
rclone python example
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