from kodexa_document import Document
from kodexa_document.accessors import NoteInput, NoteType, DataObjectInput
with Document() as doc:
root = doc.create_node("document", "Invoice")
doc.content_node = root
# Create a simple text note
note = doc.notes.create(NoteInput(
title="Review Comment",
content="This invoice needs manager approval.",
note_type=NoteType.text
))
print(f"Created note: {note}")
# Create a markdown note
doc.notes.create(NoteInput(
title="Processing Notes",
content="## Summary\n- Vendor: Acme Corp\n- Status: **Pending Review**",
note_type=NoteType.markdown
))
# Create a note attached to a data object
invoice = doc.data_objects.create(DataObjectInput(path="/invoice"))
doc.notes.create(NoteInput(
title="Extraction Note",
content="Confidence is low for the total amount field.",
note_type=NoteType.text,
data_object_id=invoice['id']
))