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 Distribution

ucp_content-0.1.8.tar.gz (189.9 kB view details)

Uploaded Source

Built Distribution

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

ucp_content-0.1.8-cp312-cp312-manylinux_2_34_x86_64.whl (2.3 MB view details)

Uploaded CPython 3.12manylinux: glibc 2.34+ x86-64

File details

Details for the file ucp_content-0.1.8.tar.gz.

File metadata

  • Download URL: ucp_content-0.1.8.tar.gz
  • Upload date:
  • Size: 189.9 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.1.0 CPython/3.13.7

File hashes

Hashes for ucp_content-0.1.8.tar.gz
Algorithm Hash digest
SHA256 2297e09d1f4a7dbc2f54440f6614cc16a82aefbdb7a3c1f90aa68538a1a644da
MD5 79d769bf5ff87e08338ab875ea2c4452
BLAKE2b-256 b733287524e80bf0a4558223728535313a22e17c607f3f7e1b355f20c41bc8ac

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for ucp_content-0.1.8-cp312-cp312-manylinux_2_34_x86_64.whl
Algorithm Hash digest
SHA256 b847d8d253949cbf472995fc4832e7fc35de14fa448d2b0827de8c1383e4ed07
MD5 e6c10a659e1bafc20610080de1ee0720
BLAKE2b-256 ec03d87078a7a1b5ba800ec727a1d70fc253b3a0441cd426cd2d53fe228ec6cf

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