# ProllyTree Python Bindings
[](https://prollytree.readthedocs.io/en/latest/)
[](https://pypi.org/project/prollytree/)
Python bindings for ProllyTree - a probabilistic tree data structure that combines B-trees and Merkle trees for efficient, verifiable data storage.
## 🚀 Quick Start
### Installation
```bash
pip install prollytree
```
### Basic Usage
```python
from prollytree import ProllyTree
# Create a tree and insert data
tree = ProllyTree()
tree.insert(b"hello", b"world")
value = tree.find(b"hello") # Returns b"world"
```
## 📚 Documentation
**👉 [Complete Documentation](https://prollytree.readthedocs.io/en/latest/)**
The full documentation includes:
- [Quickstart Guide](https://prollytree.readthedocs.io/en/latest/quickstart.html)
- [API Reference](https://prollytree.readthedocs.io/en/latest/api.html)
- [Examples](https://prollytree.readthedocs.io/en/latest/examples.html)
- [Advanced Usage](https://prollytree.readthedocs.io/en/latest/advanced.html)
## ✨ Features
- **🌳 Probabilistic Trees** - High-performance data storage with automatic balancing
- **🤖 AI Agent Memory** - Multi-layered memory systems for intelligent agents
- **📚 Versioned Storage** - Git-like version control for key-value data
- **🔐 Cryptographic Verification** - Merkle proofs for data integrity across trees and versioned storage
- **⚡ SQL Queries** - Query your data using SQL syntax
## 🔥 Key Use Cases
### Probabilistic Trees
```python
from prollytree import ProllyTree
tree = ProllyTree()
tree.insert(b"user:123", b"Alice")
tree.insert(b"user:456", b"Bob")
# Cryptographic verification
proof = tree.generate_proof(b"user:123")
is_valid = tree.verify_proof(proof, b"user:123", b"Alice")
```
### AI Agent Memory
```python
from prollytree import AgentMemorySystem
memory = AgentMemorySystem("./agent_memory", "agent_001")
# Store conversation
memory.store_conversation_turn("chat_123", "user", "Hello!")
memory.store_conversation_turn("chat_123", "assistant", "Hi there!")
# Store facts
memory.store_fact("person", "john", '{"name": "John", "age": 30}',
confidence=0.95, source="profile")
```
### Versioned Storage
```python
from prollytree import VersionedKvStore
store = VersionedKvStore("./data")
store.insert(b"config", b"production_settings")
commit_id = store.commit("Add production config")
# Branch and experiment
store.create_branch("experiment")
store.insert(b"feature", b"experimental_data")
store.commit("Add experimental feature")
# Cryptographic verification on versioned data
proof = store.generate_proof(b"config")
is_valid = store.verify_proof(proof, b"config", b"production_settings")
```
### SQL Queries
```python
from prollytree import ProllySQLStore
sql_store = ProllySQLStore("./database")
sql_store.execute("CREATE TABLE users (id INT, name TEXT)")
sql_store.execute("INSERT INTO users VALUES (1, 'Alice')")
results = sql_store.execute("SELECT * FROM users WHERE name = 'Alice'")
```
## 🛠️ Development
### Building from Source
```bash
git clone https://github.com/zhangfengcdt/prollytree
cd prollytree
./python/build_python.sh --all-features --install
```
### Running Tests
```bash
cd python/tests
python test_prollytree.py
```
## 📄 License
Licensed under the Apache License, Version 2.0
Raw data
{
"_id": null,
"home_page": null,
"name": "prollytree",
"maintainer": null,
"docs_url": null,
"requires_python": ">=3.8",
"maintainer_email": "Feng Zhang <f.feng.zhang@gmail.com>",
"keywords": "prolly, tree, probabilistic, merkle, hash, data-structures, btree, merkle-tree",
"author": "Feng Zhang <f.feng.zhang@gmail.com>",
"author_email": "Feng Zhang <f.feng.zhang@gmail.com>",
"download_url": "https://files.pythonhosted.org/packages/1b/52/ccc9e2ad84d4c8cfe00183b4b9c3709f16ed44dc5bbe62e9c470170a93d0/prollytree-0.3.1.tar.gz",
"platform": null,
"description": "# ProllyTree Python Bindings\n\n[](https://prollytree.readthedocs.io/en/latest/)\n[](https://pypi.org/project/prollytree/)\n\nPython bindings for ProllyTree - a probabilistic tree data structure that combines B-trees and Merkle trees for efficient, verifiable data storage.\n\n## \ud83d\ude80 Quick Start\n\n### Installation\n\n```bash\npip install prollytree\n```\n\n### Basic Usage\n\n```python\nfrom prollytree import ProllyTree\n\n# Create a tree and insert data\ntree = ProllyTree()\ntree.insert(b\"hello\", b\"world\")\nvalue = tree.find(b\"hello\") # Returns b\"world\"\n```\n\n## \ud83d\udcda Documentation\n\n**\ud83d\udc49 [Complete Documentation](https://prollytree.readthedocs.io/en/latest/)**\n\nThe full documentation includes:\n- [Quickstart Guide](https://prollytree.readthedocs.io/en/latest/quickstart.html)\n- [API Reference](https://prollytree.readthedocs.io/en/latest/api.html)\n- [Examples](https://prollytree.readthedocs.io/en/latest/examples.html)\n- [Advanced Usage](https://prollytree.readthedocs.io/en/latest/advanced.html)\n\n## \u2728 Features\n\n- **\ud83c\udf33 Probabilistic Trees** - High-performance data storage with automatic balancing\n- **\ud83e\udd16 AI Agent Memory** - Multi-layered memory systems for intelligent agents\n- **\ud83d\udcda Versioned Storage** - Git-like version control for key-value data\n- **\ud83d\udd10 Cryptographic Verification** - Merkle proofs for data integrity across trees and versioned storage\n- **\u26a1 SQL Queries** - Query your data using SQL syntax\n\n## \ud83d\udd25 Key Use Cases\n\n### Probabilistic Trees\n```python\nfrom prollytree import ProllyTree\n\ntree = ProllyTree()\ntree.insert(b\"user:123\", b\"Alice\")\ntree.insert(b\"user:456\", b\"Bob\")\n\n# Cryptographic verification\nproof = tree.generate_proof(b\"user:123\")\nis_valid = tree.verify_proof(proof, b\"user:123\", b\"Alice\")\n```\n\n### AI Agent Memory\n```python\nfrom prollytree import AgentMemorySystem\n\nmemory = AgentMemorySystem(\"./agent_memory\", \"agent_001\")\n\n# Store conversation\nmemory.store_conversation_turn(\"chat_123\", \"user\", \"Hello!\")\nmemory.store_conversation_turn(\"chat_123\", \"assistant\", \"Hi there!\")\n\n# Store facts\nmemory.store_fact(\"person\", \"john\", '{\"name\": \"John\", \"age\": 30}',\n confidence=0.95, source=\"profile\")\n```\n\n### Versioned Storage\n```python\nfrom prollytree import VersionedKvStore\n\nstore = VersionedKvStore(\"./data\")\nstore.insert(b\"config\", b\"production_settings\")\ncommit_id = store.commit(\"Add production config\")\n\n# Branch and experiment\nstore.create_branch(\"experiment\")\nstore.insert(b\"feature\", b\"experimental_data\")\nstore.commit(\"Add experimental feature\")\n\n# Cryptographic verification on versioned data\nproof = store.generate_proof(b\"config\")\nis_valid = store.verify_proof(proof, b\"config\", b\"production_settings\")\n```\n\n### SQL Queries\n```python\nfrom prollytree import ProllySQLStore\n\nsql_store = ProllySQLStore(\"./database\")\nsql_store.execute(\"CREATE TABLE users (id INT, name TEXT)\")\nsql_store.execute(\"INSERT INTO users VALUES (1, 'Alice')\")\nresults = sql_store.execute(\"SELECT * FROM users WHERE name = 'Alice'\")\n```\n\n## \ud83d\udee0\ufe0f Development\n\n### Building from Source\n```bash\ngit clone https://github.com/zhangfengcdt/prollytree\ncd prollytree\n./python/build_python.sh --all-features --install\n```\n\n### Running Tests\n```bash\ncd python/tests\npython test_prollytree.py\n```\n\n## \ud83d\udcc4 License\n\nLicensed under the Apache License, Version 2.0\n\n",
"bugtrack_url": null,
"license": "Apache-2.0",
"summary": "Python bindings for ProllyTree - a probabilistic tree for efficient storage and retrieval",
"version": "0.3.1",
"project_urls": {
"Bug Tracker": "https://github.com/zhangfengcdt/prollytree/issues",
"Documentation": "https://docs.rs/prollytree",
"Homepage": "https://github.com/zhangfengcdt/prollytree",
"Repository": "https://github.com/zhangfengcdt/prollytree.git"
},
"split_keywords": [
"prolly",
" tree",
" probabilistic",
" merkle",
" hash",
" data-structures",
" btree",
" merkle-tree"
],
"urls": [
{
"comment_text": null,
"digests": {
"blake2b_256": "793e83066736242bd2c1b65d2550914f999c5e510580a28aed5edbdffb69f85e",
"md5": "5d81c56486c4c634a8d5162ba4700997",
"sha256": "fc5db3707eed86fca2fad9c51202d7eee5805fdbbd0517e7626ce8622626d4c0"
},
"downloads": -1,
"filename": "prollytree-0.3.1-cp311-cp311-macosx_11_0_arm64.whl",
"has_sig": false,
"md5_digest": "5d81c56486c4c634a8d5162ba4700997",
"packagetype": "bdist_wheel",
"python_version": "cp311",
"requires_python": ">=3.8",
"size": 4698636,
"upload_time": "2025-08-29T15:28:15",
"upload_time_iso_8601": "2025-08-29T15:28:15.060750Z",
"url": "https://files.pythonhosted.org/packages/79/3e/83066736242bd2c1b65d2550914f999c5e510580a28aed5edbdffb69f85e/prollytree-0.3.1-cp311-cp311-macosx_11_0_arm64.whl",
"yanked": false,
"yanked_reason": null
},
{
"comment_text": null,
"digests": {
"blake2b_256": "1b52ccc9e2ad84d4c8cfe00183b4b9c3709f16ed44dc5bbe62e9c470170a93d0",
"md5": "e0245499ff03a68b91eb7f2b31b52cf2",
"sha256": "219c7b8b84803a239d38d2a11c3c70fa0f4af5aaf7f59467b9bbab152ed833f7"
},
"downloads": -1,
"filename": "prollytree-0.3.1.tar.gz",
"has_sig": false,
"md5_digest": "e0245499ff03a68b91eb7f2b31b52cf2",
"packagetype": "sdist",
"python_version": "source",
"requires_python": ">=3.8",
"size": 343862,
"upload_time": "2025-08-29T15:28:16",
"upload_time_iso_8601": "2025-08-29T15:28:16.822054Z",
"url": "https://files.pythonhosted.org/packages/1b/52/ccc9e2ad84d4c8cfe00183b4b9c3709f16ed44dc5bbe62e9c470170a93d0/prollytree-0.3.1.tar.gz",
"yanked": false,
"yanked_reason": null
}
],
"upload_time": "2025-08-29 15:28:16",
"github": true,
"gitlab": false,
"bitbucket": false,
"codeberg": false,
"github_user": "zhangfengcdt",
"github_project": "prollytree",
"travis_ci": false,
"coveralls": false,
"github_actions": true,
"lcname": "prollytree"
}