Skip to content

Commit 7565ec8

Browse files
committed
chore: init license and readme
1 parent 5765048 commit 7565ec8

File tree

2 files changed

+92
-1
lines changed

2 files changed

+92
-1
lines changed

LICENSE

+21
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,21 @@
1+
MIT License
2+
3+
Copyright (c) 2024 Loro
4+
5+
Permission is hereby granted, free of charge, to any person obtaining a copy
6+
of this software and associated documentation files (the "Software"), to deal
7+
in the Software without restriction, including without limitation the rights
8+
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
9+
copies of the Software, and to permit persons to whom the Software is
10+
furnished to do so, subject to the following conditions:
11+
12+
The above copyright notice and this permission notice shall be included in all
13+
copies or substantial portions of the Software.
14+
15+
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
16+
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
17+
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
18+
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
19+
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
20+
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
21+
SOFTWARE.

README.md

+71-1
Original file line numberDiff line numberDiff line change
@@ -1 +1,71 @@
1-
# loro-py
1+
[![PyPI version](https://badge.fury.io/py/loro.svg)](https://badge.fury.io/py/loro)
2+
[![License](https://img.shields.io/badge/license-MIT-blue.svg)](LICENSE)
3+
4+
<h1 align="center">loro-py</h1>
5+
6+
<p align="center">
7+
<a aria-label="X" href="https://x.com/loro_dev" target="_blank">
8+
<img alt="" src="https://img.shields.io/badge/Twitter-black?style=for-the-badge&logo=Twitter">
9+
</a>
10+
<a aria-label="Discord-Link" href="https://discord.gg/tUsBSVfqzf" target="_blank">
11+
<img alt="" src="https://img.shields.io/badge/Discord-black?style=for-the-badge&logo=discord">
12+
</a>
13+
</p>
14+
15+
Python bindings for [Loro CRDT](https://github.com/loro-dev/loro) library, powered by [PyO3](https://github.com/PyO3/pyo3).
16+
17+
## Features
18+
19+
- High-performance CRDT operations with Rust implementation
20+
- Rich data types support: Text, List, Map, Tree, Movable List, Counter (WIP)
21+
- Python-friendly API design (WIP)
22+
23+
## Installation
24+
25+
```shell
26+
pip install loro
27+
```
28+
29+
## Quick Start
30+
31+
```python
32+
from loro import LoroDoc
33+
34+
# Create a new document
35+
doc = LoroDoc()
36+
# Get a text container
37+
text = doc.get_text("text")
38+
# Insert text
39+
text.insert(0, "Hello, Loro!")
40+
doc.subscribe(lambda e: print(e))
41+
doc.commit()
42+
```
43+
44+
## Development
45+
46+
### Prerequisites
47+
48+
- Python 3.8+
49+
- Rust toolchain
50+
- [maturin](https://github.com/PyO3/maturin)
51+
52+
### Setup Development Environment
53+
54+
1. Clone the repository
55+
56+
```shell
57+
git clone https://github.com/loro-dev/loro-py
58+
cd loro-py
59+
```
60+
61+
2. Install development dependencies and run
62+
63+
```shell
64+
# choose your python venv
65+
pip install maturin
66+
maturin develop
67+
```
68+
69+
## Credits
70+
71+
- [PyO3](https://github.com/PyO3/pyo3) - Rust bindings for Python

0 commit comments

Comments
 (0)