Skip to main content

fsspec-compatible backends with Rust accleration

Project description

fsspec-rs

fsspec-compatible filesystem backends with Rust acceleration

Build Status codecov License PyPI

Overview

fsspec-rs provides drop-in replacements for fsspec filesystem backends, with performance-critical operations implemented in Rust. The Python classes inherit from fsspec's real base classes (AbstractFileSystem, AbstractBufferedFile), so they work everywhere fsspec filesystems are accepted — pandas, dask, xarray, and the broader PyData ecosystem.

Backends

Backend Protocol Python class Replaces
Local filesystem file-rs, local-rs fsspec_rs.LocalFileSystem fsspec.implementations.local.LocalFileSystem
Amazon S3 s3-rs fsspec_rs.S3FileSystem s3fs.S3FileSystem

Features

  • Pure Rust core — standalone FileSystem and AsyncFileSystem traits usable from any Rust project, with no Python dependency
  • Full fsspec compatibility — inherits from real fsspec base classes, participates in the registry, and passes isinstance checks
  • Pluggable read caching — readahead, block, and all-bytes cache strategies for buffered S3 reads
  • S3 via object_store — uses the battle-tested object_store crate (from Apache Arrow) for S3 access with retries, streaming, and standard AWS credential resolution

Quick start

# Local filesystem — drop-in replacement
from fsspec_rs import LocalFileSystem

fs = LocalFileSystem()
fs.ls("/tmp")
fs.cat_file("/tmp/example.txt")

# S3 filesystem
from fsspec_rs import S3FileSystem

fs = S3FileSystem(bucket="my-bucket", region="us-east-1")
data = fs.cat_file("path/to/object.parquet")
fs.pipe_file("path/to/output.txt", b"hello")

# Works with fsspec's open() and registry
import fsspec

with fsspec.open("local-rs:///tmp/example.txt", "rb") as f:
    print(f.read())

Performance

Benchmarks comparing fsspec-rs against the pure-Python fsspec/s3fs implementations (measured with pytest-benchmark; S3 benchmarks run against a local MinIO instance):

Local filesystem

Operation fsspec-rs fsspec (Python) Speedup
ls (small dir) 6.5 µs 19.3 µs 3.0x
ls (100 files) 73.5 µs 234.3 µs 3.2x
find (recursive) 97.4 µs 326.3 µs 3.4x
walk (recursive) 86.2 µs 299.6 µs 3.5x
cat_file (4 KiB) 2.0 µs 5.7 µs 2.8x
get (100 × 4 KiB) 846 µs 1,840 µs 2.2x

S3 (vs s3fs, against MinIO)

Operation fsspec-rs s3fs (Python) Speedup
cat_file (4 KiB) 387 µs 1,190 µs 3.1x
cat_file (256 KiB) 958 µs 3,511 µs 3.7x
cat_file (4 MiB) 6,156 µs 8,884 µs 1.4x
find (recursive) 5,454 µs 11,803 µs 2.2x
pipe_file (4 KiB) 4,093 µs 5,250 µs 1.3x
get_file (4 KiB) 1,743 µs 2,816 µs 1.6x

[!NOTE] This library was generated using copier from the Base Python Project Template repository.

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

fsspec_rs-0.1.1.tar.gz (93.2 kB view details)

Uploaded Source

Built Distributions

If you're not sure about the file name format, learn more about wheel file names.

fsspec_rs-0.1.1-cp310-abi3-win_AMD64.whl (1.8 MB view details)

Uploaded CPython 3.10+Windows x86-64

fsspec_rs-0.1.1-cp310-abi3-manylinux_2_28_x86_64.whl (2.2 MB view details)

Uploaded CPython 3.10+manylinux: glibc 2.28+ x86-64

fsspec_rs-0.1.1-cp310-abi3-macosx_11_0_arm64.whl (1.9 MB view details)

Uploaded CPython 3.10+macOS 11.0+ ARM64

File details

Details for the file fsspec_rs-0.1.1.tar.gz.

File metadata

  • Download URL: fsspec_rs-0.1.1.tar.gz
  • Upload date:
  • Size: 93.2 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.2.0 CPython/3.12.12

File hashes

Hashes for fsspec_rs-0.1.1.tar.gz
Algorithm Hash digest
SHA256 99d4aafe471f346325dc4dfa6a25307e075bbda6b8d0919a3ddad0bf6926090e
MD5 8d9aa1a85e8feb06d0958d5ff64ff2f4
BLAKE2b-256 0bb4565e962dace5dbc674c25301d95ab98c1af86a35547215596fe64bc96be9

See more details on using hashes here.

File details

Details for the file fsspec_rs-0.1.1-cp310-abi3-win_AMD64.whl.

File metadata

  • Download URL: fsspec_rs-0.1.1-cp310-abi3-win_AMD64.whl
  • Upload date:
  • Size: 1.8 MB
  • Tags: CPython 3.10+, Windows x86-64
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.2.0 CPython/3.12.12

File hashes

Hashes for fsspec_rs-0.1.1-cp310-abi3-win_AMD64.whl
Algorithm Hash digest
SHA256 63859ed0c0869935a3786e6f39b9c5a415d44a105592db885932275ff21b95bd
MD5 092ad92eaf05c5ee98c59d7dc3f402f1
BLAKE2b-256 c10d1108b03657cac548eb60cd6f92324c4bb36021c68ec19d846fcba415781e

See more details on using hashes here.

File details

Details for the file fsspec_rs-0.1.1-cp310-abi3-manylinux_2_28_x86_64.whl.

File metadata

File hashes

Hashes for fsspec_rs-0.1.1-cp310-abi3-manylinux_2_28_x86_64.whl
Algorithm Hash digest
SHA256 364ed1f04d782f0a649382d91b09bb4b16ef05c7a2e735484f684dbe3770d109
MD5 0b3afebfa94fc703877f2a79fc526e3b
BLAKE2b-256 4d967a9a0b25f684f81e8b7f8f477456b2091f97c2ceaac5707564395b856a25

See more details on using hashes here.

File details

Details for the file fsspec_rs-0.1.1-cp310-abi3-macosx_11_0_arm64.whl.

File metadata

File hashes

Hashes for fsspec_rs-0.1.1-cp310-abi3-macosx_11_0_arm64.whl
Algorithm Hash digest
SHA256 ac0a92d348247e00f41f5d4ab6608cc03830ee25cd6cd3c7a9e1c4daec8327cc
MD5 9a61b608992efd131e2566780528b053
BLAKE2b-256 8773fd4a29f1745eb615d363e9e57e5c2c6d7e96762241cc6ee889d63b2cffec

See more details on using hashes here.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Pingdom Monitoring Sentry Error logging StatusPage Status page