Skip to content

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

80 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

docgen

Русский

Generate structured DOCX documents and PPTX presentations from validated JSON configurations.

docgen provides a small CLI and Python API for data-driven document generation without assumptions about organization, subject, or document category.

What it does

  • Builds DOCX files from ordered sections, reusable content blocks and fragments.
  • Builds PPTX files from typed slide configurations.
  • Expands opt-in scalar variables in user-visible text fields.
  • Generates charts and structure diagrams.
  • Embeds images and inline or external CSV tables by stable resource IDs.
  • Validates the complete project before writing output atomically.

Installation

Python 3.10 or newer is required.

python -m pip install .

For development:

python -m pip install -e '.[dev]'
python -m pytest -q

Quick start

docgen init ./my-document
docgen build ./my-document/document.json

docgen init ./my-slides --kind presentation
docgen build ./my-slides/presentation.json

Override the configured output with docgen build CONFIG -o OUTPUT. Validate without writing output with docgen validate CONFIG.

Minimal document

{
  "kind": "document",
  "output": "result.docx",
  "sections": [
    {
      "type": "content",
      "title": "Overview",
      "content": [
        {"type": "paragraph", "text": "Hello."}
      ]
    }
  ]
}

Save as document.json, then run docgen validate document.json and docgen build document.json.

Minimal presentation

{
  "kind": "presentation",
  "output": "result.pptx",
  "title": "Demo",
  "slides": [
    {"type": "title"},
    {"type": "text", "title": "One", "text": "Hello."}
  ]
}

Save as presentation.json, then run docgen validate presentation.json and docgen build presentation.json.

Documentation

  • Documents: sections, blocks, rich text, citations, and formatting.
  • Presentations: typed slides, rich text, image fitting, and overflow.
  • Variables and fragments: authoring expansion, normalization, and limits.
  • Resources: tables, figures, diagrams, images, and CSV sources.
  • CLI reference: commands, validation, diagnostics, and schemas.
  • Development: development commands and known limitations.

About

Generate structured DOCX documents and PPTX presentations from validated JSON configurations.

Resources

Stars

0 stars

Watchers

0 watching

Forks

Releases

Packages

Contributors

Languages