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.8.tar.gz
(712.7 kB
view hashes)
Built Distributions
Close
Hashes for opendal-0.45.8-cp311-abi3-win_amd64.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 85b3e8ad7d9e9a45a50444f33f95602c69a9caadef561ed1703325e2c4a63339 |
|
MD5 | 9b6ea76eb48c910afd399a5424679537 |
|
BLAKE2b-256 | 00a95ca511811ce120a31e0d6644e3bedcdc4632892a3740f102903f0a69b585 |
Close
Hashes for opendal-0.45.8-cp311-abi3-manylinux_2_17_x86_64.manylinux2014_x86_64.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | c6ef654bb38f86a4629308e20ee28f1fd3bc5fb6f089bc766bdcbc293feb450f |
|
MD5 | 4bac4afb7b9d3736e738eda7b76d4ecb |
|
BLAKE2b-256 | 71430f796ea9b2f6d1730049e70591153808f9fbf4e45666eb82835c325db762 |
Close
Hashes for opendal-0.45.8-cp311-abi3-manylinux_2_17_armv7l.manylinux2014_armv7l.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 2df3f6a2395f1ef98aef44130c5795d7b42e25eaeecf1209f2587502bf8b9a47 |
|
MD5 | cb6a18b624e13a143faa75adef71a4a3 |
|
BLAKE2b-256 | 14dcb6d0b24e00e3db45c0885821edfcfe40ed0ddc8f5a6fbb82ae21d051cd14 |
Close
Hashes for opendal-0.45.8-cp311-abi3-manylinux_2_17_aarch64.manylinux2014_aarch64.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 94a0c571617a9b20f17942534a66dc97053c3c0e46a08895aa26438fc433f713 |
|
MD5 | cba54cd464e5388b042c1e46abffbb97 |
|
BLAKE2b-256 | e7a905c43453016ba73583381660a83304f4c98b6b1596e39d89eb9965c415fa |
Close
Hashes for opendal-0.45.8-cp311-abi3-macosx_10_12_x86_64.macosx_11_0_arm64.macosx_10_12_universal2.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | d32c87f433b4625c12334a92fe0d3a1c23f620f7af29fa64f232c362b9c35e6c |
|
MD5 | 2d1013c809807598ac5b3135ea111842 |
|
BLAKE2b-256 | 9e436a2a8f9bc168c2fc55bf3dbea8d6219f5708a79c2a4a3e47fcfec0c02ef5 |