diff --git a/LICENSE b/LICENSE new file mode 100644 index 0000000..afe68a4 --- /dev/null +++ b/LICENSE @@ -0,0 +1,21 @@ +MIT License + +Copyright (c) 2024 Loro + +Permission is hereby granted, free of charge, to any person obtaining a copy +of this software and associated documentation files (the "Software"), to deal +in the Software without restriction, including without limitation the rights +to use, copy, modify, merge, publish, distribute, sublicense, and/or sell +copies of the Software, and to permit persons to whom the Software is +furnished to do so, subject to the following conditions: + +The above copyright notice and this permission notice shall be included in all +copies or substantial portions of the Software. + +THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR +IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, +FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE +AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER +LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, +OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE +SOFTWARE. diff --git a/README.md b/README.md index 9e47e68..2011bc0 100644 --- a/README.md +++ b/README.md @@ -1 +1,71 @@ -# loro-py +

loro-swift

+ +

+ + + + + + +

+ +[![PyPI version](https://badge.fury.io/py/loro.svg)](https://badge.fury.io/py/loro) +[![License](https://img.shields.io/badge/license-MIT-blue.svg)](LICENSE) + +Python bindings for [loro](https://github.com/loro-dev/loro) CRDT library, powered by [PyO3](https://github.com/PyO3/pyo3). + +## Features + +- High-performance CRDT operations with Rust implementation +- Rich data types support: Text, List, Map, Tree, Movable List, Counter (WIP) +- Python-friendly API design (WIP) + +## Installation + +```shell +pip install loro +``` + +## Quick Start + +```python +from loro import LoroDoc + +# Create a new document +doc = LoroDoc() +# Get a text container +text = doc.get_text("text") +# Insert text +text.insert(0, "Hello, Loro!") +doc.subscribe(lambda e: print(e)) +doc.commit() +``` + +## Development + +### Prerequisites + +- Python 3.7+ +- Rust toolchain +- [maturin](https://github.com/PyO3/maturin) + +### Setup Development Environment + +1. Clone the repository + +```shell +git clone https://github.com/loro-dev/loro-py +cd loro-py +``` + +2. Install development dependencies and run + +```shell +# choose your python venv +pip install maturin +maturin develop +``` + +## Credits + +- [PyO3](https://github.com/PyO3/pyo3) - Rust bindings for Python