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.9.tar.gz (193.7 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.9-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.9.tar.gz.

File metadata

  • Download URL: ucp_content-0.1.9.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

Hashes for ucp_content-0.1.9.tar.gz
Algorithm Hash digest
SHA256 a37d118da51b99b57f2ef9231545da18ab99f4b7f551042ec416f576e240bc82
MD5 04eb2e36d7a3c2cf3f814f515b07b0fe
BLAKE2b-256 83b83ac2ea8e73e21c2277ea034a0d8ee86fd28b64769b34e2be529473382cb7

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for ucp_content-0.1.9-cp312-cp312-manylinux_2_34_x86_64.whl
Algorithm Hash digest
SHA256 5b789c2033341d07429febc6219f2e339e6424edb6aa237fb405459e6c20f38f
MD5 d1bce69bb2e5fc30cdf95f16a99c7c21
BLAKE2b-256 08f3db4f399036916e6cd74d2f9aa2b663c8c64f2b37b00f5267eee7e87fd008

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