Apache OpenDAL™ Python Binding
Project description
Apache OpenDAL™ Python Binding
Documentation: main
This package intends to build a native python binding for Apache OpenDAL.
Installation
pip install opendal
Usage
fs service example:
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())
s3 service example:
import opendal
op = opendal.Operator("s3", root="/tmp", bucket="your_bucket_name", region="your_region")
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("s3", root="/tmp", bucket="your_bucket_name", region="your_region")
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
Build bindings:
maturin develop
Run some tests:
maturin develop -E test
# To run `test_write.py` and use `fs` operator
OPENDAL_TEST=fs OPENDAL_FS_ROOT=/tmp pytest -vk test_write
Build API docs:
maturin develop -E docs
pdoc -t ./template 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.
Project details
Release history Release notifications | RSS feed
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
opendal-0.45.10.tar.gz
(728.3 kB
view hashes)
Built Distributions
Close
Hashes for opendal-0.45.10-cp311-abi3-win_amd64.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | f288991fdd5a24b10a8176c66c637711fe1e1fe725c0db116233e639d067cbde |
|
MD5 | 43d9fa7812b77f48139a9163741a22f2 |
|
BLAKE2b-256 | f4530390daaec5db4ef06e7f1d144bc16876b0a471c543ec300703c66748efa9 |
Close
Hashes for opendal-0.45.10-cp311-abi3-manylinux_2_17_x86_64.manylinux2014_x86_64.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 5eac0577b57ebfd7d60bd1423b73fd4366eec020fb72b5bd8ee35259233784fb |
|
MD5 | 7467508f87681a38c903bcfe0bcf529f |
|
BLAKE2b-256 | dfcaf1321a7e1619eafd80f4ab28dbaa9481d73cb1ef2cd21a1f70dff9463fd4 |
Close
Hashes for opendal-0.45.10-cp311-abi3-manylinux_2_17_armv7l.manylinux2014_armv7l.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | cf5bc06dcc199829a03685a2da49fcf796c7d18d85892ca6747e3c489b6bca22 |
|
MD5 | 6583e792c15088841b4ab4512d82c2b3 |
|
BLAKE2b-256 | 1d0683800d671b9722e4c521ec6e282094e3e546ecb5a972bf4e754751d0ae62 |
Close
Hashes for opendal-0.45.10-cp311-abi3-manylinux_2_17_aarch64.manylinux2014_aarch64.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 1d714f1e9afea16e173095ffca24df08313fee35ac519c39a67ce2010b05ef7f |
|
MD5 | f872afedc4d2a0a2f9b05cbc3fc4b639 |
|
BLAKE2b-256 | e606dc800ae5bd1180e1d6c986386e81fd9b03b3cb6fd69c8efa0a54f92b19cf |
Close
Hashes for opendal-0.45.10-cp311-abi3-macosx_10_12_x86_64.macosx_11_0_arm64.macosx_10_12_universal2.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 16db1092a831d58beecfba858e2cc25624fcba7e57e3499c368ea2f0aa4f9030 |
|
MD5 | 10a4a5a1361ee42dc3007bd08f0fee1a |
|
BLAKE2b-256 | 44d5eb739fac7e4c6052185ec14d120dd8a6facb60d51c229b2f0df77e8ddacc |