Skip to main content

Convert AI-generated Markdown into production-ready documents

Project description

Synthkit

PyPI Python 3.10+ License: MIT Tests Coverage Ruff Checked with mypy

A "last-mile" toolkit for working with generative AI. Synthkit bridges the gap between raw LLM output and production-ready deliverables through:

  • Document conversion — Transform AI-generated Markdown into Word, HTML, PDF, or clipboard-ready email
  • Prompt templates — Curated templates for structured AI interactions (reports, emails, analysis)
  • Guidelines — Reference standards and style guides to steer AI output quality

Document Conversion

Installation

# Run directly with uvx (no install needed)
uvx synthkit html document.md

# Or install globally
uv tool install synthkit

# Or install with pip
pip install synthkit

Pandoc is bundled automatically via pypandoc_binary — no separate install needed.

System dependencies for PDF

PDF conversion uses WeasyPrint, which requires system libraries:

Platform Install command
macOS brew install pango
Ubuntu/Debian apt install libpango1.0-dev libcairo2-dev libgdk-pixbuf2.0-dev
Windows See WeasyPrint docs

doc, html, and email commands work without these.

Usage

Unified CLI

synthkit doc report.md           # → report.docx
synthkit html report.md          # → report.html
synthkit pdf report.md           # → report.pdf
synthkit email report.md         # → clipboard

# Batch processing
synthkit doc *.md
synthkit html *.md --hard-breaks

# Mermaid diagrams (requires mermaid-filter)
synthkit html report.md --mermaid

Backward-compatible commands

md2doc report.md
md2html report.md
md2pdf report.md
md2email report.md

Options

Flag Description
--hard-breaks Preserve line breaks from source markdown
--mermaid Enable Mermaid diagram rendering (requires mermaid-filter)

Configuration

Each converter looks for optional config files under ~/.config/<toolname>/:

Converter Config Files
doc ~/.config/md2doc/reference.docx
email ~/.config/md2email/style.css
html ~/.config/md2html/style.css
pdf ~/.config/md2pdf/style.css

Prompt Templates

The prompt-templates/ directory contains curated prompt templates for structured AI interactions. These are optimized for Markdown-first responses to ensure compatibility with the document conversion tools.

Copy the contents of any template into your LLM of choice (Claude, Gemini, ChatGPT, etc.) to get consistently structured output ready for conversion.

Guidelines

The guidelines/ directory contains reference standards and style guides that can be provided as context to AI models to steer output quality and consistency.

Testing

# Run tests
uv run --extra dev pytest

# With coverage
uv run --extra dev pytest --cov=synthkit --cov-report=term-missing

Tests run automatically on push/PR to main across Python 3.10-3.13 on Linux, macOS, and Windows.

Repository Structure

├── .github/workflows/
│   ├── tests.yml          # CI: test on push/PR to main
│   └── publish.yml        # CD: publish to PyPI on release
├── pyproject.toml
├── src/synthkit/          # Python package
│   ├── cli.py             # Click CLI with subcommands
│   ├── base.py            # Shared conversion logic
│   ├── doc.py             # Word conversion
│   ├── email.py           # Email clipboard conversion
│   ├── html.py            # HTML conversion
│   └── pdf.py             # PDF conversion (via WeasyPrint)
├── tests/                 # Test suite (pytest)
│   ├── conftest.py        # Shared fixtures
│   ├── test_base.py       # Base module tests
│   ├── test_cli.py        # CLI + integration tests
│   ├── test_doc.py        # Word converter tests
│   ├── test_email.py      # Email converter tests
│   ├── test_html.py       # HTML converter tests
│   └── test_pdf.py        # PDF converter tests
├── style.css              # Default stylesheet
├── prompt-templates/      # AI interaction prompt templates
└── guidelines/            # Reference guidelines

Dependencies

Package Purpose Bundled?
click CLI framework pip
pypandoc_binary Pandoc document converter pip (includes binary)
pyperclip Cross-platform clipboard pip
weasyprint PDF engine pip (needs system libs)
mermaid-filter Mermaid diagrams Optional, external

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

synthkit-0.1.0.tar.gz (77.5 kB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

synthkit-0.1.0-py3-none-any.whl (9.4 kB view details)

Uploaded Python 3

File details

Details for the file synthkit-0.1.0.tar.gz.

File metadata

  • Download URL: synthkit-0.1.0.tar.gz
  • Upload date:
  • Size: 77.5 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? Yes
  • Uploaded via: twine/6.1.0 CPython/3.13.7

File hashes

Hashes for synthkit-0.1.0.tar.gz
Algorithm Hash digest
SHA256 00d206d70f163c2e4a792aab6ae3b95036442cebc5491d301c687c2da315df39
MD5 d9fccbe00a2e06233ffd9ca57262765b
BLAKE2b-256 aeaec62e4a3ec91286260b2dc2f57fb9079414a5a1690530f05b92c5030492de

See more details on using hashes here.

Provenance

The following attestation bundles were made for synthkit-0.1.0.tar.gz:

Publisher: publish.yml on rappdw/synthkit

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

File details

Details for the file synthkit-0.1.0-py3-none-any.whl.

File metadata

  • Download URL: synthkit-0.1.0-py3-none-any.whl
  • Upload date:
  • Size: 9.4 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? Yes
  • Uploaded via: twine/6.1.0 CPython/3.13.7

File hashes

Hashes for synthkit-0.1.0-py3-none-any.whl
Algorithm Hash digest
SHA256 1fc15dd64a3fdb1c1bcf2840c937d74d41fe3ba7a38dd2a723e74082dea3d6d1
MD5 419612a4dace3a5c2eabd5282fabea2e
BLAKE2b-256 65ac12cf33dccb742401c0df7b7a5b891b431c08132b2ffc77120aba03f1c6fb

See more details on using hashes here.

Provenance

The following attestation bundles were made for synthkit-0.1.0-py3-none-any.whl:

Publisher: publish.yml on rappdw/synthkit

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

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