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.4.tar.gz
(702.3 kB
view hashes)
Built Distributions
Close
Hashes for opendal-0.45.4-cp311-abi3-win_amd64.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 69418f6ee3d98e1267257fd01b81b633d2f72a96a8021eaf1de8213cea51047e |
|
MD5 | 320a19af3c4a5bd280f905701cf2fc46 |
|
BLAKE2b-256 | c6cc0615d087b997e5947352e4f498378476abf321b513e37b70ae767796ca9b |
Close
Hashes for opendal-0.45.4-cp311-abi3-manylinux_2_17_x86_64.manylinux2014_x86_64.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 43e00ba9cdeeec4b127372ad10185c64a5cb5b0474b7902ab22e092f3958e5c3 |
|
MD5 | f9242010d6bc62571e81850edac550fa |
|
BLAKE2b-256 | 12d9a11c135b973d6128f3d0b7945ac6d6fd746352602ba6f29b4b6d5d699e93 |
Close
Hashes for opendal-0.45.4-cp311-abi3-manylinux_2_17_armv7l.manylinux2014_armv7l.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 09bde351dd35ca98bfd7ffc99c8f9cff40e3062bd7e9abc909c701ff16f509e6 |
|
MD5 | deece2b097020e179c6d352dbdf7467d |
|
BLAKE2b-256 | 149719021b8726c34d4d85c60ef1dfe74c4a89ee4295c26aa36c7bccadda6714 |
Close
Hashes for opendal-0.45.4-cp311-abi3-manylinux_2_17_aarch64.manylinux2014_aarch64.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 0257f51fa538380b5afcdc655c1231196decbe2540dee2402151414301dca045 |
|
MD5 | df5955270024c3c772eb70fb1db488a8 |
|
BLAKE2b-256 | 221501a26ed7f8bc39039c07a46b01500e173587d7fac4f4f2e54b9ebccb28ab |
Close
Hashes for opendal-0.45.4-cp311-abi3-macosx_10_12_x86_64.macosx_11_0_arm64.macosx_10_12_universal2.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | b6451390f76c7c429a057715533a10c50543cda919565c7fea2a4d97dff7ef02 |
|
MD5 | 49590fd78bd5620f751990476f769012 |
|
BLAKE2b-256 | 2ca097029eb3b7a6402d414cf4cb452e38b396ec9223143bf358b2b3de0961ad |