Skip to main content

RCloneFileSystem: fsspec-Compatible Filesystem via rclone

This package provides a fully fsspec-compliant filesystem interface backed by rclone.

Installation

pip install rclone-filesystem

Quick Start

Given an rclone remote rclone config create myremote s3 ... you can use the RCloneFileSystem as follows:

from rclone_filesystem import RCloneFileSystem

fs = RCloneFileSystem(remote="myremote")

# List files
fs.ls("data")  # path, e.g. bucket name for S3

# Read and write files
with fs.open("data/test-file.txt", "wb") as f:
    f.write(b"Hello, World!")

with fs.open("data/test-file.txt", "rb") as f:
    content = f.read()

# Text mode
with fs.open("data/test-file.txt", "w") as f:
    f.write("Hello, World!")

with fs.open("data/test-file.txt", "r") as f:
    text = f.read()

Features

Protocol Registration

The filesystem registers itself as rclone://, enabling URL-based access:

import fsspec

fs = fsspec.filesystem("rclone", remote="myremote")
# or
with fsspec.open("rclone://myremote:bucket/file.txt", "rb") as f:
    data = f.read()

File Operations

# Upload / download
fs.put_file("local.txt", "bucket/remote.txt")
fs.get_file("bucket/remote.txt", "local.txt")

# Copy within remote
fs.cp_file("bucket/src.txt", "bucket/dst.txt")

# Delete
fs.rm_file("bucket/file.txt")

# Read file content directly
data = fs.cat_file("bucket/file.txt")

Directory Operations

fs.mkdir("bucket/new-dir")
fs.rmdir("bucket/old-dir")  # removes directory and all contents recursively

Listing and Metadata

# List directory contents
fs.ls("bucket")                    # returns list of names
fs.ls("bucket", detail=True)       # returns list of dicts with metadata

# Get file/directory info
fs.info("bucket/file.txt")         # returns metadata dict

Caching

Directory listings are cached automatically. Cache behavior can be controlled:

fs = RCloneFileSystem(
    remote="myremote",
    listings_expiry_time_secs=60,  # cache TTL in seconds
    use_listings_cache=False,       # disable caching entirely
)

# Force refresh a listing
fs.ls("bucket", refresh=True)

# Manually invalidate cache
fs.invalidate_cache("bucket")

Configuration

Settings can be provided via constructor arguments, environment variables (prefixed with RCLONE_FS_), or pyproject.toml:

fs = RCloneFileSystem(
    remote="myremote",
    temp_dir="/tmp/rclone",   # directory for temp files during transfers
    show_progress=True,       # show rclone transfer progress
)
Constructor Argument Environment Variable Default
temp_dir RCLONE_FS_TEMP_DIR None (system default)
listings_expiry_time_secs RCLONE_FS_LISTINGS_EXPIRY_TIME_SECS None
show_progress RCLONE_FS_SHOW_PROGRESS False

pyproject.toml example:

[tool.rclone-filesystem]
temp_dir = "/tmp/rclone"
show_progress = true
listings_expiry_time_secs = 60.0

Priority: constructor args > environment variables > pyproject.toml > defaults.

Metadata

Release files for rclone-filesystem 0.2.0

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-filesystem 0.2.0
File Size Uploaded Provenance
rclone_filesystem-0.2.0.tar.gz 235.8 kB Without provenance Details

Built distribution (wheel)

Table of built distributions (wheels) for rclone-filesystem 0.2.0
File Interpreter ABI Platform
rclone_filesystem-0.2.0-py3-none-any.whl Python 3 none any Details

Total release size: 248.3 kB

Release files / rclone_filesystem-0.2.0.tar.gz

Download URL rclone_filesystem-0.2.0.tar.gz
Size 235.8 kB
Tags Source
SHA-256 checksum
How to use checksums
81e757c81c6fc1d990893b2d537e8d8870a739b08879ce7a925bd62027260ac4
BLAKE2b-256 checksum
How to use checksums
a4ea42dfc8e7fc8e0202eb74830a046176a8f8ceef2151292676eea3a3414b86
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via uv/0.10.8 {"installer":{"name":"uv","version":"0.10.8","subcommand":["publish"]},"python":null,"implementation":{"name":null,"version":null},"distro":{"name":"Ubuntu","version":"24.04","id":"noble","libc":null},"system":{"name":null,"release":null},"cpu":null,"openssl_version":null,"setuptools_version":null,"rustc_version":null,"ci":true}

Release files / rclone_filesystem-0.2.0-py3-none-any.whl

Download URL rclone_filesystem-0.2.0-py3-none-any.whl
Size 12.5 kB
Tags Python 3
SHA-256 checksum
How to use checksums
92743689d61b1f53fa775973acefaf39a3a60ba44b3582c60b21e3a66879b457
BLAKE2b-256 checksum
How to use checksums
0da5113ebc856b636e3e5c0103636109c9f7fdffc6b51e0209b18541a4e1b07c
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via uv/0.10.8 {"installer":{"name":"uv","version":"0.10.8","subcommand":["publish"]},"python":null,"implementation":{"name":null,"version":null},"distro":{"name":"Ubuntu","version":"24.04","id":"noble","libc":null},"system":{"name":null,"release":null},"cpu":null,"openssl_version":null,"setuptools_version":null,"rustc_version":null,"ci":true}

Security for rclone-filesystem 0.2.0

Provenance

Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.

No provenance found

None of the files in this release were uploaded with provenance metadata.

A note on package security

PyPI is a repository for distributing packages, not a service for auditing them. While third-party security researchers and our staff do their best to detect and remove malicious packages, PyPI cannot guarantee the quality, security or suitability of any given package.

To learn more about protecting yourself from malicious actors, visit our package security documentation.

Release history Release notifications | RSS feed

This release

0.2.0 This release

2 release files No provenance

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