Socket
Book a DemoInstallSign in
Socket

loro

Package Overview
Dependencies
Maintainers
2
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

loro

Python bindings for [Loro](https://loro.dev)

pipPyPI
Version
1.6.0
Maintainers
2

PyPI version License

loro-py

Python bindings for Loro CRDT. If you have any issues or suggestions, please feel free to create an issue or join our Discord community.

Features

  • High-performance CRDT operations with Rust implementation
  • Rich data types support: Text, List, Map, Tree, Movable List, Counter
  • Python-friendly API design

Installation

pip install loro

Quick Start

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!")
# store the `subscription` reference to prevent garbage collection
sub = doc.subscribe_root(lambda e: print(e))
doc.commit()

Development

Prerequisites

  • Python 3.8+
  • Rust toolchain
  • maturin

Setup Development Environment

  • Clone the repository
git clone https://github.com/loro-dev/loro-py
cd loro-py
  • Install development dependencies and run
# choose your python venv
pip install maturin
maturin develop

Keywords

local-first

FAQs

Did you know?

Socket

Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.

Install

Related posts