Skip to content

Commit

Permalink
chore: init license and readme
Browse files Browse the repository at this point in the history
  • Loading branch information
Leeeon233 committed Dec 31, 2024
1 parent 5765048 commit 7565ec8
Show file tree
Hide file tree
Showing 2 changed files with 92 additions and 1 deletion.
21 changes: 21 additions & 0 deletions LICENSE
Original file line number Diff line number Diff line change
@@ -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.
72 changes: 71 additions & 1 deletion README.md
Original file line number Diff line number Diff line change
@@ -1 +1,71 @@
# loro-py
[![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)

<h1 align="center">loro-py</h1>

<p align="center">
<a aria-label="X" href="https://x.com/loro_dev" target="_blank">
<img alt="" src="https://img.shields.io/badge/Twitter-black?style=for-the-badge&logo=Twitter">
</a>
<a aria-label="Discord-Link" href="https://discord.gg/tUsBSVfqzf" target="_blank">
<img alt="" src="https://img.shields.io/badge/Discord-black?style=for-the-badge&logo=discord">
</a>
</p>

Python bindings for [Loro CRDT](https://github.com/loro-dev/loro) 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.8+
- 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

0 comments on commit 7565ec8

Please sign in to comment.