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.9.tar.gz
(727.0 kB
view hashes)
Built Distributions
Close
Hashes for opendal-0.45.9-cp311-abi3-win_amd64.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 34ba5f29156f7b04e6483e8c6e87c34f3a74b1b21ca0d70eede0e28f1fdafaa2 |
|
MD5 | 124c8d6951756968e422ab4a21fd8548 |
|
BLAKE2b-256 | 0c94504b15a9f4ae9827ade21ce643e5d20ba3e2cdef23557174d964b8bd1ce8 |
Close
Hashes for opendal-0.45.9-cp311-abi3-manylinux_2_17_x86_64.manylinux2014_x86_64.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | ca5e43b7c8e605d36453a73187b2191798fb0fe6f5575428b8cab5bb4f6d4e40 |
|
MD5 | 67e8642303fcbbaa0a40e2c79fa73514 |
|
BLAKE2b-256 | 01f962d780f1098be23ab4da1a75a62f384f76e1cf3c3913aff49d7a209532c5 |
Close
Hashes for opendal-0.45.9-cp311-abi3-manylinux_2_17_armv7l.manylinux2014_armv7l.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | d58b44cfc0c317aa7ee1ce210f2640cf6494809fbf82960492aa069230f6a12c |
|
MD5 | c9844f0af879a5e5ea455c2a73f55f89 |
|
BLAKE2b-256 | 43cd9ab85e554cd679db719ca12fe9a0a91cc3a3ae7284a459c0d0163fe272f3 |
Close
Hashes for opendal-0.45.9-cp311-abi3-manylinux_2_17_aarch64.manylinux2014_aarch64.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 860f303ec24f7da60d4f04b172f9cb8e61a64457c83d786e36d25deeb6931d36 |
|
MD5 | 45ccecdf5fe64ea005d17095d4aaef88 |
|
BLAKE2b-256 | 1f9c52f81e54ade011a8b0a3f418919c6b3ecd6b7957e93f6dd494a0e0598790 |
Close
Hashes for opendal-0.45.9-cp311-abi3-macosx_10_12_x86_64.macosx_11_0_arm64.macosx_10_12_universal2.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 6d93e3681148a2693363be35c9b8dc1a8499d02c033f68f5b5b8c0859534b879 |
|
MD5 | c17e5711a1606c6f70fc2500dccdd52d |
|
BLAKE2b-256 | 1a5b073b08885aec4573b6618771dc1a3e7a665a3fdcf44265279871c4a5788e |