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.6.tar.gz
(703.5 kB
view hashes)
Built Distributions
Close
Hashes for opendal-0.45.6-cp311-abi3-win_amd64.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | ddfac058ba55f8b520452b5a02e9dcf6035c014d2c8e591cd224a64fa778eeba |
|
MD5 | c7f9825de9652c03ce198b25b5ca5f9c |
|
BLAKE2b-256 | a124e2aa4b3330d68010e2ca219be200a7101eb79946e6fedeaaff9133799fc8 |
Close
Hashes for opendal-0.45.6-cp311-abi3-manylinux_2_17_x86_64.manylinux2014_x86_64.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 79ccaff9a10342f45dbd880647e501d258bf64b7d49656ba6831ff9d9e523369 |
|
MD5 | 26c675f73db6ce1ef2b0dc8ea8cff89c |
|
BLAKE2b-256 | e98827dfc6a02a816253b9d18b7f05760e12cd2400252592ce8b5d01f6dde110 |
Close
Hashes for opendal-0.45.6-cp311-abi3-manylinux_2_17_armv7l.manylinux2014_armv7l.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | d4c57da10f669cba178a5f91195ccc2bc8f2013d8d0df5cd468be0cb5e21cd2b |
|
MD5 | 4dea32801af89c8d597c7da83c0bcf32 |
|
BLAKE2b-256 | b4afd153f559236ec3675fca972ecd932134c23a5109df33b74f07382f8b18b9 |
Close
Hashes for opendal-0.45.6-cp311-abi3-manylinux_2_17_aarch64.manylinux2014_aarch64.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 2e1f77096444cff48a2859db6aad3e2647db16d0bb8947638e3f022b333bd70c |
|
MD5 | f521bb3223ba96a17f34c2314e2501c9 |
|
BLAKE2b-256 | 4addd2603121d2a83a5773932bca4754bc1aa8624d4d4a072070370cb88bc1a6 |
Close
Hashes for opendal-0.45.6-cp311-abi3-macosx_10_12_x86_64.macosx_11_0_arm64.macosx_10_12_universal2.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | e0df69e184de2dd1b1c33588b9960a25a42f59ff196990463c88c1c1cab9f168 |
|
MD5 | 0a4dd64e58f91f15a7b1b22a8fcd03f4 |
|
BLAKE2b-256 | ba30c835b51a6ef5e4876e950fc39e3ba871409b511add0f5af29c03ba630b47 |