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.10.tar.gz
(193.7 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.10.tar.gz.
File metadata
- Download URL: ucp_content-0.1.10.tar.gz
- Upload date:
- Size: 193.7 kB
- Tags: Source
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/6.1.0 CPython/3.13.7
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
66fa01ca7d0a533452c5ac2ed7400bdd8f59f3147f5a7f001d0213b0bc11d8f6
|
|
| MD5 |
5835d2b3eb0e03df8dab6e60f0a78b04
|
|
| BLAKE2b-256 |
f5fbfcf71f65369670721576431d1d20b745c133e7447b313b3320ea0541997f
|
File details
Details for the file ucp_content-0.1.10-cp312-cp312-manylinux_2_34_x86_64.whl.
File metadata
- Download URL: ucp_content-0.1.10-cp312-cp312-manylinux_2_34_x86_64.whl
- Upload date:
- Size: 2.2 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 |
9cc7afdd35385ed52e1b247e9256f732d21c7c5fd346b39e722cc63fc6ad65b9
|
|
| MD5 |
66b305b7d07f84ab54e1d24cea9ec5d2
|
|
| BLAKE2b-256 |
f273b1a9ecf0e297a97cc76dc78a5468cacd280933b820053fb252c466f81dd5
|