#storage #data #s3 #fs #azblob

opendal

Open Data Access Layer that empowers everyone to access different storage services painless and efficiently

41 releases (12 breaking)

Uses new Rust 2021

new 0.12.0 Aug 12, 2022
0.11.3 Jul 26, 2022
0.3.0 Mar 25, 2022

#19 in Filesystem

Download history 1097/week @ 2022-04-25 1331/week @ 2022-05-02 1508/week @ 2022-05-09 1916/week @ 2022-05-16 1807/week @ 2022-05-23 1895/week @ 2022-05-30 2226/week @ 2022-06-06 3245/week @ 2022-06-13 3044/week @ 2022-06-20 2798/week @ 2022-06-27 1895/week @ 2022-07-04 4576/week @ 2022-07-11 8539/week @ 2022-07-18 9679/week @ 2022-07-25 8230/week @ 2022-08-01 8245/week @ 2022-08-08

35,134 downloads per month
Used in 2 crates

Apache-2.0

370KB
7.5K SLoC

OpenDAL   Build Status Latest Version Crate Downloads

Open Data Access Layer: Access data freely, painless, and efficiently


You may be looking for:

Services

  • azblob: Azure Storage Blob services.
  • fs: POSIX alike file system.
  • hdfs: Hadoop Distributed File System(HDFS).
  • http: HTTP read-only services.
  • memory: In memory backend.
  • s3: AWS S3 alike services.

Features

  • Access different storage system in the same way
  • Native decompress support
  • Native service-side encryption support
  • Powerful Layer
  • 100% documents covered
  • Behavior tests for all services

Quickstart

use anyhow::Result;
use futures::StreamExt;
use futures::TryStreamExt;
use opendal::DirEntry;
use opendal::DirStreamer;
use opendal::Object;
use opendal::ObjectMetadata;
use opendal::ObjectMode;
use opendal::Operator;
use opendal::Scheme;

#[tokio::main]
async fn main() -> Result<()> {
    // Init Operator
    let op = Operator::from_env(Scheme::Fs)?;

    // Create object handler.
    let o = op.object("test_file");

    // Write data info object;
    o.write("Hello, World!").await?;

    // Read data from object;
    let bs = o.read().await?;

    // Read range from object;
    let bs = o.range_read(1..=11).await?;

    // Get object's path
    let name = o.name();
    let path = o.path();

    // Fetch more meta about object.
    let meta = o.metadata().await?;
    let mode = meta.mode();
    let length = meta.content_length();
    let content_md5 = meta.content_md5();
    let etag = meta.etag();

    // Delete object.
    o.delete().await?;

    // List dir object.
    let o = op.object("test_dir/");
    let mut ds = o.list().await?;
    while let Some(entry) = ds.try_next().await? {
        let path = entry.path();
        let mode = entry.mode();
    }

    Ok(())
}

More examples could be found at Documentation.

Projects

  • databend: A modern Elasticity and Performance cloud data warehouse.

Contributing

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

Getting help

Submit issues for bug report or asking questions in discussion.

License

Licensed under Apache License, Version 2.0.

Dependencies

~26–35MB
~755K SLoC