Python bindings for UCP (Unified Content Protocol) - Rust implementation
Project description
UCP - Unified Content Protocol
Python bindings for the Rust UCP implementation.
Installation
pip install ucp-content
Usage
import ucp
# Create a document
doc = ucp.create("My Document")
# Add blocks
root = doc.root_id
block1 = doc.add_block(root, "Hello, World!", role="paragraph")
# Edit blocks
doc.edit_block(block1, "Updated content")
# Render to markdown
md = ucp.render(doc)
print(md)
Features
- Document Operations: Create, edit, move, delete blocks
- Traversal: Children, parent, ancestors, descendants, siblings
- Finding: By tag, label, role, content type
- Edges: Create relationships between blocks
- LLM Utilities: IdMapper for token-efficient prompts, PromptBuilder for UCL generation
- Snapshots: Version control for documents
- UCL Execution: Execute UCL commands on documents
API Reference
See the documentation for full API reference.
Project details
Release history Release notifications | RSS feed
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
ucp_content-0.1.12.tar.gz
(224.8 kB
view details)
Built Distribution
Filter files by name, interpreter, ABI, and platform.
If you're not sure about the file name format, learn more about wheel file names.
Copy a direct link to the current filters
File details
Details for the file ucp_content-0.1.12.tar.gz.
File metadata
- Download URL: ucp_content-0.1.12.tar.gz
- Upload date:
- Size: 224.8 kB
- Tags: Source
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/6.1.0 CPython/3.13.7
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
266fa814fd174b7ab19475854e126059b91aa15762aee3427784470759a40da4
|
|
| MD5 |
6e0f3e2faec63bb26b0a7790f4e5600b
|
|
| BLAKE2b-256 |
5691da84b53f6fa8a9802b9656bcfdc7c12521e4cf9a85f9c163dde32df0c052
|
File details
Details for the file ucp_content-0.1.12-cp312-cp312-manylinux_2_34_x86_64.whl.
File metadata
- Download URL: ucp_content-0.1.12-cp312-cp312-manylinux_2_34_x86_64.whl
- Upload date:
- Size: 2.3 MB
- Tags: CPython 3.12, manylinux: glibc 2.34+ x86-64
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/6.1.0 CPython/3.13.7
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
4f42e4fca3b6095c581f731c51d67a4a9082a18bbdedf0d8720b71406b126c70
|
|
| MD5 |
4469cf1ea41ac7ccd4e1673a74d0f14c
|
|
| BLAKE2b-256 |
5da83f065c5b2de25352c0c1f68ad83d246b42403a7d1d2741b38bbbaa1edf12
|