Skip to content

Latest commit

 

History

History
77 lines (52 loc) · 1.06 KB

README.md

File metadata and controls

77 lines (52 loc) · 1.06 KB

OpenDAL Python Binding

Documentation: main

This crate intends to build a native python binding.

Installation

pip install opendal

Usage

import opendal

op = opendal.Operator("fs", root="/tmp")
op.write("test.txt", b"Hello World")
print(op.read("test.txt"))
print(op.stat("test.txt").content_length)

Or using the async API:

import asyncio

async def main():
    op = opendal.AsyncOperator("fs", root="/tmp")
    await op.write("test.txt", b"Hello World")
    print(await op.read("test.txt"))

asyncio.run(main())

Development

Setup virtualenv:

python -m venv venv

Activate venv:

source venv/bin/activate

Install maturin:

pip install maturin[patchelf]

Build bindings:

maturin develop

Run some tests:

maturin develop -E test
behave tests

Build API docs:

maturin develop -E docs
pdoc opendal