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.3.tar.gz
(700.6 kB
view hashes)
Built Distributions
Close
Hashes for opendal-0.45.3-cp311-abi3-win_amd64.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | b1cfe334518816e9cb2459a1a75a7eaba864129aa9f266ff6f71fceaaa70face |
|
MD5 | 4681da1d7df7ca20151b9c7866252782 |
|
BLAKE2b-256 | 80c96669293fe8a5a59505ac6c7e37f5738dc58c1767523a8add91987d521866 |
Close
Hashes for opendal-0.45.3-cp311-abi3-manylinux_2_17_x86_64.manylinux2014_x86_64.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 4e5809f546e705a21f73e0d4c1a3ddc6e14e505a8ecebd8949d75aad818259cb |
|
MD5 | 82b072500156ff5e91afe2df2f76d93f |
|
BLAKE2b-256 | 4d757a6dcbd11d4bcc1a4ea9e042b152395355ee1d3bdd000de7ee2fe04b0d12 |
Close
Hashes for opendal-0.45.3-cp311-abi3-manylinux_2_17_armv7l.manylinux2014_armv7l.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 01aec21454490eaad62295d2ac60b969d790ce4b0809e50a8c36b384332a8325 |
|
MD5 | c6ac24a1dd1f09786a37a6f78a9feccd |
|
BLAKE2b-256 | 51dafa5741716ae0fb08dfde093d42779975d02736b55418dbcb19f677d914a9 |
Close
Hashes for opendal-0.45.3-cp311-abi3-manylinux_2_17_aarch64.manylinux2014_aarch64.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 57673ecc6bb8e4638e7c4fa978433c5acd85e1b6699c22fb22bc4ed7665947bd |
|
MD5 | 4b4d13883abe032bd7c0eed34133bc09 |
|
BLAKE2b-256 | d07f995ae8323edc57efbdf8a243d1a8bf3b1f8b5f82d327a185ce29453ea687 |
Close
Hashes for opendal-0.45.3-cp311-abi3-macosx_10_12_x86_64.macosx_11_0_arm64.macosx_10_12_universal2.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 8342bf4d19d9bf976d1abea8e7ed67f8387f8dce2ad001abbf50b271da6f8fa9 |
|
MD5 | 7f3296b6977d1837dc04807a3dcddf73 |
|
BLAKE2b-256 | 677bf34bf367fd0691219cd17079f84c0616333c9cd7d3947653a6d466bd4e42 |