Skip to main content

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


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distributions

No source distribution files available for this release.See tutorial on generating distribution archives.

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

ucp_content-0.1.6-cp312-cp312-manylinux_2_34_x86_64.whl (1.5 MB view details)

Uploaded CPython 3.12manylinux: glibc 2.34+ x86-64

File details

Details for the file ucp_content-0.1.6-cp312-cp312-manylinux_2_34_x86_64.whl.

File metadata

File hashes

Hashes for ucp_content-0.1.6-cp312-cp312-manylinux_2_34_x86_64.whl
Algorithm Hash digest
SHA256 f7c19d8dbed36d612b4bdd178d4f061d35b1ab19abcc20241252a8fd769fa183
MD5 0e3322a6adaf196a8046eaada08a0336
BLAKE2b-256 aa55896240d704bf02baa3be1d4f973e882d3179af0f70a3f5cba17884431a0e

See more details on using hashes here.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Pingdom Monitoring Sentry Error logging StatusPage Status page