Skip to main content

ppt-quality-review

Quality-review stack for generated slide decks. Three layers:

  1. Heuristic description review — 4D/5D quality frameworks (Structure, Density, CRAP design principles, Scene, Visual richness) scoring slide description dicts, plus CJK-aware content-density and image-density analyzers.
  2. Static gate — pluggable subprocess adapter for an external SVG checker script (exit 0 = pass).
  3. Render-level VLM visual QC — render slide SVGs to PNGs (Playwright), review each page with a vision LLM (blocking vs cosmetic severity tiers), and produce re-authoring feedback strings.

Install

pip install ppt-quality-review

Optional extras (as declared in pyproject.toml):

  • [llm]openai>=1.0.0 + httpx>=0.24.0, for the default VLM client (ppt_common.llm.LLMClient, OpenAI-compatible).
  • [visual]playwright>=1.40 + pillow>=10.0, for the SVG→PNG renderer (ppt_quality_review.svg_render).
  • [dev]pytest>=7.0, for working on the package itself.

Layer 1 (heuristics) and Layer 2 (static gate) need no extras beyond the ppt-common base dependency.

Quickstart

A runnable offline version of this example (no API key needed) ships in examples/heuristic_review.py.

from ppt_quality_review import analyze_quality_5d

slides = [
    {"type": "content", "title": "Intro",
     "bullets": ["Point one", "Point two"], "image_path": "a.png"},
    {"type": "content", "title": "Details",
     "bullets": ["Fact A", "Fact B"], "image_path": "b.png"},
]
report = analyze_quality_5d(slides)
print(report.overall_score, [str(i) for i in report.all_issues])

Bring your own VLM client (Layer 3)

Any object with one method satisfies VisionReviewer:

from ppt_quality_review import review_rendered_pages
from ppt_quality_review.svg_render import render_svg_dir

class MyReviewer:
    def chat_with_images(self, user_prompt, image_paths, *, model=""):
        ...  # call your VLM of choice, return the raw text response

render = render_svg_dir(svg_dir, out_dir)          # needs [visual] extra
review = review_rendered_pages(render["pages"], page_briefs,
                               client=MyReviewer())
print(review.blocking)  # [(page_index, issue), ...]

The default client (ppt_common.llm.LLMClient, OpenAI-compatible/DashScope) is used when client=None; it needs the [llm] extra and DASHSCOPE_API_KEY/LLM_API_KEY env vars. Any OpenAI-compatible endpoint works: LLMClient also honors LLM_BASE_URL / LLM_MODEL (with DASHSCOPE_BASE_URL / DASHSCOPE_MODEL fallbacks), or explicit api_key= / base_url= / model= arguments.

Static gate

from ppt_quality_review import SubprocessStaticGate, run_quality_gate

gate = SubprocessStaticGate(script_dir="/path/to/checker/scripts")
result = gate.run(svg_project_dir)   # GateResult(passed, exit_code, output)

Unconfigured gates soft-pass (exit_code=-1); host projects pin their own checker via the script_dir arg.

Unavailable ≠ failure. When script_dir is configured but the checker script itself is missing from it, the gate also soft-passes with exit_code=-1 and logs a WARNING — a missing checker never blocks a build. In practice this only triggers on a corrupted or partial checkout of the checker scripts.

Integration

The three layers compose into an author→gate→render→review→re-author loop; the host pipeline decides when to invoke each layer. Layers 1 and 2 are offline; Layer 3 needs the [llm] and [visual] extras.

Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

ppt_quality_review-1.0.0.tar.gz (36.9 kB view details)

Uploaded Source

Built Distribution

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

ppt_quality_review-1.0.0-py3-none-any.whl (27.0 kB view details)

Uploaded Python 3

File details

Details for the file ppt_quality_review-1.0.0.tar.gz.

File metadata

  • Download URL: ppt_quality_review-1.0.0.tar.gz
  • Upload date:
  • Size: 36.9 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/7.0.0 CPython/3.13.15

File hashes

Hashes for ppt_quality_review-1.0.0.tar.gz
Algorithm Hash digest
SHA256 5b61765d04e02b70c1b3b8ecff8b810731f8a6f3034f52f5239fd2a97658f5c5
MD5 95276c9fd67c7043c9b955ee59c3f8cb
BLAKE2b-256 cc16452961671630ab76a5b84363fef745f066e491cfecbbaa95754cc53cc760

See more details on using hashes here.

File details

Details for the file ppt_quality_review-1.0.0-py3-none-any.whl.

File metadata

File hashes

Hashes for ppt_quality_review-1.0.0-py3-none-any.whl
Algorithm Hash digest
SHA256 e15414a24be23b71e8b896593306b9e1b4ee656243e2e2209104ac8a4921d1be
MD5 abb40a4bcc7936730dbf01e8b061aeca
BLAKE2b-256 37d95e0217d8ecfee4e1d656100837a905fa2e2be934b9ca65ab634781364f1e

See more details on using hashes here.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page