Skip to main content
Pre-release

This release is a pre-release and may not be stable for production use.

files-sdk

Unified Python SDK for cloud object/blob storage. Python port of files-sdk.dev.

One API, swap the adapter to change backend. Sync and async are both first-class — every adapter ships an XAdapter (sync) and AsyncXAdapter (async) sibling, driven by Files or AsyncFiles. v0 ships R2, S3, and Local adapters; 15 cloud providers scaffolded for contributors.

uv add files-sdk
uv add files-sdk-local             # zero deps, ideal for dev/test
uv add files-sdk-s3                # Amazon S3 (sync + async)
uv add files-sdk-r2                # Cloudflare R2 (sync + async)

pip install ... works too if you're not on uv yet. Get uv: curl -LsSf https://astral.sh/uv/install.sh | sh.

Sync ↔ async pairs

Sync Async
Client Files AsyncFiles
Local LocalAdapter AsyncLocalAdapter
S3 S3Adapter AsyncS3Adapter
R2 R2Adapter AsyncR2Adapter
Registry slug local / s3 / r2 local-async / s3-async / r2-async

Method signatures, kwargs, and return types are identical across the two — the async versions just need await. stream() is the one principled split: Iterator[bytes] on Files, AsyncIterator[bytes] on AsyncFiles (consume with async for).

Quickstart — no credentials (Local)

Sync:

from files_sdk import Files
from files_sdk_local import LocalAdapter

files = Files(adapter=LocalAdapter(root="/tmp/my-store"))
files.upload("hello.txt", b"hi")
print(files.download("hello.txt").text())

Async:

import asyncio
from files_sdk import AsyncFiles
from files_sdk_local import AsyncLocalAdapter

async def main():
    files = AsyncFiles(adapter=AsyncLocalAdapter(root="/tmp/my-store"))
    await files.upload("hello.txt", b"hi")
    print((await files.download("hello.txt")).text())

asyncio.run(main())

Quickstart — Cloudflare R2

Sync:

from files_sdk import Files
from files_sdk_r2 import R2Adapter

# Reads R2_ACCOUNT_ID, R2_ACCESS_KEY_ID, R2_SECRET_ACCESS_KEY from env
files = Files(adapter=R2Adapter(bucket="my-bucket"))
files.upload("hello.txt", b"hi")

Async:

from files_sdk import AsyncFiles
from files_sdk_r2 import AsyncR2Adapter

files = AsyncFiles(adapter=AsyncR2Adapter(bucket="my-bucket"))
await files.upload("hello.txt", b"hi")

Quickstart — Amazon S3

Sync:

from files_sdk import Files
from files_sdk_s3 import S3Adapter

# Reads standard AWS env: AWS_ACCESS_KEY_ID, AWS_SECRET_ACCESS_KEY, AWS_REGION
files = Files(adapter=S3Adapter(bucket="my-bucket"))

Async:

from files_sdk import AsyncFiles
from files_sdk_s3 import AsyncS3Adapter

files = AsyncFiles(adapter=AsyncS3Adapter(bucket="my-bucket"))
await files.upload("hello.txt", b"hi")

Streaming (bounded memory)

# Sync
with open("out.bin", "wb") as f:
    for chunk in files.stream("big.bin", chunk_size=1 << 20):
        f.write(chunk)

# Async
async for chunk in afiles.stream("big.bin", chunk_size=1 << 20):
    ...

Adapter lookup by name

from files_sdk import AsyncFiles, Files

files  = Files.from_name("local", root="/tmp/my-store")         # sync
files  = Files.from_name("s3", bucket="my-bucket")               # sync
afiles = AsyncFiles.from_name("s3-async", bucket="my-bucket")    # async

Crossing the wires — handing a sync adapter to AsyncFiles or vice versa — raises FilesError("invalid_input") at construction, so the two paths can never silently blend.

API

Both Files and AsyncFiles expose the same surface. await the async ones.

Method Purpose
upload(key, body, *, content_type=None, metadata=None, cache_control=None) Store an object. body is bytes, str, Path, or a file-like.
download(key) Return a StoredFile (fully buffered).
stream(key, *, chunk_size=65536) Yield chunks. Iterator[bytes] on Files, AsyncIterator[bytes] on AsyncFiles.
head(key) Return FileMetadata without the body.
delete(key) Remove an object. Idempotent (no error on missing).
list(*, prefix=None, cursor=None, limit=1000) Paginated listing. Returns ListPage.
copy(src, dst) Server-side copy.
url(key, *, expires_in=3600, public=False) Signed or public URL.
signed_upload_url(key, *, method="put"|"post", expires_in=3600, ...) Browser-direct upload contract.
raw Escape hatch — provider-native client (sync or async, matching the wrapper).

Errors raise FilesError with code in {"not_found", "unauthorized", "conflict", "provider", "invalid_input"} and the original exception preserved via __cause__. The error type is shared across sync and async.

Metadata

Release files for files-sdk 0.1.0a2

For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.

Source distribution (sdist)

Source distribution for files-sdk 0.1.0a2
File Size Uploaded Provenance Actions
files_sdk-0.1.0a2.tar.gz 11.3 kB With provenance Details for files_sdk-0.1.0a2.tar.gz

Built distribution (wheel)

Table of built distributions (wheels) for files-sdk 0.1.0a2
File Interpreter ABI Platform Actions
files_sdk-0.1.0a2-py3-none-any.whl Python 3 none any Details for files_sdk-0.1.0a2-py3-none-any.whl

Total release size: 22.2 kB

Release files / files_sdk-0.1.0a2.tar.gz

Download URL files_sdk-0.1.0a2.tar.gz
Size 11.3 kB
Tags Source
SHA-256 checksum
How to use checksums
19cd03c9196fe30eeccbd70b3341fc027fdee0448c53819162da7d3e46604030
BLAKE2b-256 checksum
How to use checksums
a6f65558b648b5c261077c790e45416dceda6d11bb20d5e953b369bd506f83a9
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
Yes
Uploaded via twine/6.1.0 CPython/3.13.12

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.

PyPI Publish Attestation

PyPI verified that this artifact, at this checksum, originated from the publisher listed below.

Signed by GitHub Actions, verified by PyPI on May 14, 2026.

Transparency log

Release files / files_sdk-0.1.0a2-py3-none-any.whl

Download URL files_sdk-0.1.0a2-py3-none-any.whl
Size 10.9 kB
Tags Python 3
SHA-256 checksum
How to use checksums
eb336863d391924ebb07837027cb48080b183d661c00fa5cb90d7d1d965d6e1f
BLAKE2b-256 checksum
How to use checksums
42f9861f68fcc4f4a1169c83f2ee0a2ec6d1f50e57ad37ac39c83cf0fb87bdd4
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
Yes
Uploaded via twine/6.1.0 CPython/3.13.12

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.

PyPI Publish Attestation

PyPI verified that this artifact, at this checksum, originated from the publisher listed below.

Signed by GitHub Actions, verified by PyPI on May 14, 2026.

Transparency log

Security for files-sdk 0.1.0a2

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.

Full provenance

Both files in this release have been uploaded with provenance metadata.

Select from 2 files

Attestation for files_sdk-0.1.0a2.tar.gz

PyPI Publish Attestation

PyPI verified that this artifact, at this checksum, originated from the publisher listed below.

Signed by GitHub Actions, verified by PyPI on May 14, 2026.

Transparency log

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.

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