tree: 100ba7ba08116f86e23b4ee5f7d50eb64c7a7aac [search]
  1. benchmark/
  2. docs/
  3. examples/
  4. python/
  5. scripts/
  6. src/
  7. template/
  8. tests/
  9. .gitignore
  10. Cargo.toml
  11. CONTRIBUTING.md
  12. DEPENDENCIES.md
  13. DEPENDENCIES.rust.tsv
  14. justfile
  15. LICENSE
  16. LICENSE-libgcc.txt
  17. LICENSE-MPL-2.0.txt
  18. mkdocs.yml
  19. NOTICE
  20. pyproject.toml
  21. README.md
  22. ruff.toml
  23. upgrade.md
  24. users.md
  25. uv.lock
bindings/python/README.md

Apache OpenDAL™ Python Binding

Status PyPI Website

This package provides a native Python binding for Apache OpenDAL™, a data access layer that allows you to access various storage services in a unified way.

OpenDAL Architecture

We release the OpenDAL Python binding independently of the opendal crate (Rust core). For updates and compatibility, use the Python binding version instead of the opendal crate version.

Useful Links

Installation

The OpenDAL Python binding requires Python 3.11 or later. We retire each Python version in the first binding release line after that Python version reaches upstream end of life.

Install from PyPI:

pip install opendal

Or install from Anaconda main:

conda install opendal

Or install from conda-forge:

conda install conda-forge::opendal

Services in PyPI wheels

Official PyPI wheels ship the largest verified service set for each target. Every wheel enables the common services-all group plus one of the services-platform-* sets in the binding's Cargo.toml. The release workflow selects the set for each target and builds both standard and free-threaded CPython.

Wheel platformArchitectureFeature setAdditional services
Linux (manylinux)x86_64, aarch64services-platform-linuxFoyer, SFTP
Linux (musllinux)x86_64, aarch64services-platform-linuxFoyer, SFTP
Linux (manylinux and musllinux)ARMv7 (32-bit)services-platform-linux-armv7None
macOSx86_64, arm64services-platform-macosFoyer, SFTP
Windowsx86_64services-platform-windowsFoyer

Foyer's Linux dependency io-uring lacks prebuilt ARMv7 bindings. SFTP requires the OpenSSH ssh executable at runtime. Its Rust dependency chain supports Unix and fails to build for ARMv7 at the supported Rust version.

Build with additional services

To add D1 to the common service set, run this from bindings/python in an active virtual environment with Maturin installed:

maturin develop --release --features services-all,services-d1

Python layers such as RetryLayer and MimeGuessLayer are built in. Exposing a new Rust layer requires Python binding code.

Quickstart

import opendal

# Configure a service, then build an operator from it.
op = opendal.Operator("fs", root="/tmp")

# The same verbs work on every service.
op.write("test.txt", b"Hello World")
print(op.read("test.txt"))
print(op.stat("test.txt").content_length)

To use a real backend, change the scheme and pass its configuration — the operations stay identical:

op = opendal.Operator("s3", bucket="your_bucket", region="your_region")

OpenDAL also has a first-class async API via opendal.AsyncOperator. See Getting started and Connecting to your storage for the full guide.

Multiprocessing

Use multiprocessing.get_context("spawn") when starting workers after OpenDAL has initialized its Tokio runtime. On Unix, OpenDAL raises RuntimeError if a child tries to use a runtime inherited through fork(). If you use fork, start workers before creating a blocking Operator or running an async OpenDAL operation, and initialize OpenDAL in each child.

Contributing

This project uses just as a command runner. For a complete guide on building, testing, and contributing, see CONTRIBUTING.md.

Used By

Check out the users list for more details on who is using OpenDAL.

License and Trademarks

Licensed under the Apache License, Version 2.0: http://www.apache.org/licenses/LICENSE-2.0

Apache OpenDAL, OpenDAL, and Apache are either registered trademarks or trademarks of the Apache Software Foundation.

Third-party software

Compiled distributions include the following Mozilla Public License 2.0 components. Their source code is available from the linked project pages:

The distribution includes the MPL-2.0 text in LICENSE-MPL-2.0.txt.

Musllinux wheels also bundle libgcc_s, the GCC runtime library, licensed under GPL-3.0-or-later WITH GCC-exception-3.1. The complete license and exception texts are included in LICENSE-libgcc.txt.