Skip to main content

declarativedocs

Python reference compiler for the Declarative Document Format (DDF). Turns YAML into real documents.

Install

pip install declarativedocs

Supported formats

Format Schema Status
Presentation (.pptx) presentation: ✅ Available
Document (.docx) document: 🔜 Planned
PDF (.pdf) pdf: 🔜 Planned

The compiler auto-detects the format from the YAML root key.

Usage

CLI

ddf my-deck.yaml                    # → my-deck.pptx (auto-detected)
ddf my-deck.yaml output.pptx        # → explicit output path

Python API

from declarativedocs import compile

compile("my-deck.yaml", "output.pptx")

Element types (Presentation)

Type Description
text Text box with plain text, rich text runs, or bullet lists
shape Rectangle, rounded rectangle, oval, line
image Image from file path or base64
chart Bar, line, pie, doughnut, scatter, radar
table Data table with styled cells
group Auto-layout container (row or grid) with card styling
icon Colored circle with glyph character

Features

  • Theme variables — Define colors and fonts once, reference with $name
  • Slide masters — Reusable templates with {{placeholder}} data binding
  • Auto-layout — row and grid with configurable gap
  • Card styling — Fill, radius, shadow, border on group items
  • Shadow presets — default, soft, hard, glow, up
  • Bullet lists — Proper indentation and tight spacing
  • Icons in cards — Automatic positioning above text

Quick example

presentation:
  layout: "16x9"
  theme:
    colors:
      primary: "1E2761"
      white: "FFFFFF"
    fonts:
      heading: Georgia

  slides:
    - background: $primary
      elements:
        - type: text
          x: 1  y: 2  w: 8  h: 1.5
          text: "Hello DDF"
          font: $heading
          size: 44
          color: $white
          bold: true
          align: center
ddf hello.yaml  # → hello.pptx

Schema

See the full DDF specification.

Examples

See the examples/ directory for complete YAML files.

Why DDF?

LLMs currently write 800+ lines of imperative library code to produce a 10-slide deck. DDF describes the same deck in ~200 lines of YAML. That's 3-5x fewer tokens, with significantly fewer bugs.

DDF is a declarative spec — the LLM describes what it wants, the compiler figures out how. The YAML is the contract, the compiler is a swappable implementation detail.

License

Apache 2.0

Metadata

Release files for declarativedocs 0.1.2

For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.

Source distribution (sdist)

Source distribution for declarativedocs 0.1.2
File Size Uploaded Provenance Actions
declarativedocs-0.1.2.tar.gz 67.7 kB Without provenance Details for declarativedocs-0.1.2.tar.gz

Built distribution (wheel)

Table of built distributions (wheels) for declarativedocs 0.1.2
File Interpreter ABI Platform Actions
declarativedocs-0.1.2-py3-none-any.whl Python 3 none any Details for declarativedocs-0.1.2-py3-none-any.whl

Total release size: 82.8 kB

Release files / declarativedocs-0.1.2.tar.gz

Download URL declarativedocs-0.1.2.tar.gz
Size 67.7 kB
Tags Source
SHA-256 checksum
How to use checksums
73474e04b0bbf49d1ffc47a06c1f06ede372c225ea8fcc50dc32fffdb895fe2b
BLAKE2b-256 checksum
How to use checksums
38519a9add887f810107e1342d605a4ed88aaa0acfaaebac1afee4f0f33793ff
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/6.2.0 CPython/3.12.8

Release files / declarativedocs-0.1.2-py3-none-any.whl

Download URL declarativedocs-0.1.2-py3-none-any.whl
Size 15.1 kB
Tags Python 3
SHA-256 checksum
How to use checksums
1094d09500bb33a202e0cfd33188d88c7a90c35151c44f50dd1be5391e1fae20
BLAKE2b-256 checksum
How to use checksums
49c2eebb4d5fa9fc70e35791c7d94ebc6fbd6351cf525a9b1379b6ab1349eb16
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/6.2.0 CPython/3.12.8

Security for declarativedocs 0.1.2

Provenance

Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.

No provenance found

None of the files in this release were uploaded with provenance metadata.

A note on package security

PyPI is a repository for distributing packages, not a service for auditing them. While third-party security researchers and our staff do their best to detect and remove malicious packages, PyPI cannot guarantee the quality, security or suitability of any given package.

To learn more about protecting yourself from malicious actors, visit our package security documentation.

Anthropic, PBC Visionary sponsor Bloomberg Visionary sponsor Hudson River Trading Visionary sponsor Meta Visionary sponsor NVIDIA Visionary sponsor Microsoft Sustainability sponsor Depot Continuous Integration AWS Cloud computing and Security Sponsor Datadog Monitoring Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page