Skip to content

API overview

The CLI is the shortest route for normal backups. The Python API exposes each stage separately for applications that need custom storage, rendering, OCR, or workflow orchestration.

Module Purpose
glyphive.archive Serialize a tree, list selected paths, and parse archive records
glyphive.codec Resolve named printable codecs and use base16g-crc16-rs
glyphive.compression Resolve whole-stream compression methods
glyphive.layout Paginate encoded lines and validate protected pages
glyphive.render Resolve and invoke text, PDF, and Word renderers
glyphive.restore Decode a document and safely write archive records
glyphive.restore.ocr Discover providers and OCR one or more images

Pipeline

archive.archive_tree(root)
  -> compression.get(name).compress(raw)
  -> codec.get("base16g-crc16-rs").encode(payload)
  -> layout.paginate(lines, metadata, lines_per_page=...)
  -> render.render(pages, output, format)

restore.decode_document(text_lines)
  -> restore.unarchive_bytes(raw, destination)

Registry names are serialized in the protected document header. Treat them as wire identifiers: adding an implementation under a new name is extensible; changing the behavior of an existing identifier breaks compatibility.

Optional renderer and OCR dependencies are checked only when the corresponding implementation is selected.