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.7.tar.gz
(708.9 kB
view hashes)
Built Distributions
Close
Hashes for opendal-0.45.7-cp311-abi3-win_amd64.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 6833450d693e3b1d1dbcfc8478d461a46f4756f4bf423477ecd9484d03aa57fe |
|
MD5 | 0f8e2c6a40d4f03d9ed0481d54fbb69f |
|
BLAKE2b-256 | 5ba2b51a93f75b5c2319b563d6b9db74260bc1009158f29bd588e85e4ad08fa4 |
Close
Hashes for opendal-0.45.7-cp311-abi3-manylinux_2_17_x86_64.manylinux2014_x86_64.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 2700223ac91607556e1bad998b178ed912622931823de968a14514a07147e863 |
|
MD5 | ffe7bb2faf4f351f04cc70eceda32cab |
|
BLAKE2b-256 | a7e3c658d51ff496d6a1a4a01255e8dd6977006b3a118e3a50a43a7b58f42341 |
Close
Hashes for opendal-0.45.7-cp311-abi3-manylinux_2_17_armv7l.manylinux2014_armv7l.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 06b032a67cb1654de033bcf1d25ef7a54aa55aef1d5c053482c1a152e064bba0 |
|
MD5 | c744981d8096320413f3e0f2c5542cc0 |
|
BLAKE2b-256 | 78ef3fd28cdbb0754ba6d3a1eadcaca47caf8457da39b9698a93fc838d0e4343 |
Close
Hashes for opendal-0.45.7-cp311-abi3-manylinux_2_17_aarch64.manylinux2014_aarch64.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 90fc9138e14c6864fd9fa15d77a3e0f16a7f29262b03a0edea6677ba071ac64a |
|
MD5 | 676f2fec3ec33f74eecf5d0987fabbeb |
|
BLAKE2b-256 | 9845ebb928af72f594fdc9295b02995b19fea6e1f436ab3e3330826b176e8ec0 |
Close
Hashes for opendal-0.45.7-cp311-abi3-macosx_10_12_x86_64.macosx_11_0_arm64.macosx_10_12_universal2.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 29749f52f80404ff3e3ef40d55fec484138081a4f8d8775a186d3a418292810c |
|
MD5 | 496d3266f69edb8af7918f58e1c4a650 |
|
BLAKE2b-256 | fb6ccd6e26232ff515f4d4660587e630e6c5b7a8ffe87851caee3c242699d351 |