126 releases (46 breaking)

0.46.0 May 6, 2024
0.45.1 Mar 2, 2024
0.45.0 Feb 5, 2024
0.44.0 Dec 31, 2023
0.3.0 Mar 25, 2022

#1 in #s3

Download history 18753/week @ 2024-01-29 17495/week @ 2024-02-05 12385/week @ 2024-02-12 17186/week @ 2024-02-19 19588/week @ 2024-02-26 19603/week @ 2024-03-04 17041/week @ 2024-03-11 20731/week @ 2024-03-18 19143/week @ 2024-03-25 15755/week @ 2024-04-01 12679/week @ 2024-04-08 13879/week @ 2024-04-15 15819/week @ 2024-04-22 11386/week @ 2024-04-29 14335/week @ 2024-05-06 13318/week @ 2024-05-13

55,717 downloads per month
Used in 45 crates (31 directly)

Apache-2.0

3MB
57K SLoC

Apache OpenDAL™

Build Status Latest Version Crate Downloads chat

OpenDAL is a data access layer that allows users to easily and efficiently retrieve data from various storage services in a unified way.

Services

Standard Storage Protocols (like ftp, webdav)
  • ftp: FTP and FTPS
  • http: HTTP read-only services
  • sftp: SFTP services being worked on
  • webdav: WebDAV Service
Object Storage Services (like s3, gcs, azblob)
File Storage Services (like fs, azdls, hdfs)
Consumer Cloud Storage Service (like gdrive, onedrive, icloud drive)
Key-Value Storage Service (like rocksdb, sled)
Cache Storage Service (like memcached, moka)

Welcome to add any services that are not currently supported here.

Features

Access data freely

  • Access different storage services in the same way
  • Behavior tests for all services

Access data painlessly

Access data efficiently

  • Zero cost: Maps to API calls directly
  • Best effort: Automatically selects best read/seek/next based on services
  • Avoid extra calls: Reuses metadata when possible

Quickstart

use opendal::Result;
use opendal::layers::LoggingLayer;
use opendal::services;
use opendal::Operator;

#[tokio::main]
async fn main() -> Result<()> {
    // Pick a builder and configure it.
    let mut builder = services::S3::default();
    builder.bucket("test");

    // Init an operator
    let op = Operator::new(builder)?
        // Init with logging layer enabled.
        .layer(LoggingLayer::default())
        .finish();

    // Write data
    op.write("hello.txt", "Hello, World!").await?;

    // Read data
    let bs = op.read("hello.txt").await?;

    // Fetch metadata
    let meta = op.stat("hello.txt").await?;
    let mode = meta.mode();
    let length = meta.content_length();

    // Delete
    op.delete("hello.txt").await?;

    Ok(())
}

Examples

The examples are available at here.

Contributing

Check out the CONTRIBUTING guide for more details on getting started with contributing to this project.

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.

Dependencies

~9–63MB
~1M SLoC