Skip to content

Commit

Permalink
fix(bindings/python): Fix the metadata for Python binding
Browse files Browse the repository at this point in the history
Signed-off-by: Frost Ming <[email protected]>
  • Loading branch information
frostming committed Mar 10, 2023
1 parent 0be8ec7 commit 66af209
Show file tree
Hide file tree
Showing 2 changed files with 39 additions and 1 deletion.
32 changes: 31 additions & 1 deletion bindings/python/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,37 @@

This crate intends to build a native python binding.

## Building
## Installation

```bash
pip install opendal
```

## Usage

```python
import opendal

op = opendal.Operator("fs", root="/tmp")
op.write("test.txt", "Hello World")
print(op.read("test.txt"))
print(op.stat("test.txt").content_length)
```

Or using the async API:

```python
import asyncio

async main():
op = opendal.AsyncOperator("fs", root="/tmp")
await op.write("test.txt", "Hello World")
print(await op.read("test.txt"))

asyncio.run(main())
```

## Development

Install `maturin`:

Expand Down
8 changes: 8 additions & 0 deletions bindings/python/pyproject.toml
Original file line number Diff line number Diff line change
Expand Up @@ -23,4 +23,12 @@ classifiers = [
"Programming Language :: Python :: Implementation :: PyPy",
]
name = "opendal"
description = "OpenDAL Python Binding"
requires-python = ">=3.7"
license = {text = "Apache-2.0"}
readme = "README.md"

[project.urls]
Homepage = "https://opendal.databend.rs/"
Repository = "https://github.com/datafuselabs/opendal"
Documentation = "https://docs.rs/opendal/"

0 comments on commit 66af209

Please sign in to comment.