Skip to main content

Parser, validator, and summarizer for PLAYBOOK.md — multi-step AI workflows in markdown

Project description

playbook-md

Parser, validator, and summarizer for PLAYBOOK.md files — multi-step AI workflows written in plain markdown.

Installation

pip install playbook-md

Quick start

from playbook_md import parse_playbook, validate_playbook, summarize_playbook

markdown = open("my-workflow.playbook.md").read()

# Parse
result = parse_playbook(markdown)
if result.definition:
    print(f"Playbook: {result.definition.title}")
    print(f"Steps: {len(result.definition.steps)}")

# Validate
validation = validate_playbook(markdown)
if validation.valid:
    print("Playbook is valid!")
else:
    for err in validation.fatal_errors:
        print(f"Error: {err.message}")

# Summarize
if result.definition:
    summary = summarize_playbook(result.definition)
    print(f"Inputs: {summary.input_count}, Steps: {summary.step_count}")

API

  • parse_playbook(markdown: str) -> ParseResult — Parse a PLAYBOOK.md string into a structured definition.
  • validate_playbook(markdown: str) -> ValidationResult — Parse and semantically validate a PLAYBOOK.md string.
  • summarize_playbook(definition: PlaybookDefinition) -> PlaybookSummary — Generate a compact summary of a parsed playbook.
  • playbook_to_json(markdown: str) -> str — Parse a PLAYBOOK.md string and return the definition as JSON.
  • json_to_playbook(json_str: str) -> str — (Not yet implemented) Convert JSON back to PLAYBOOK.md markdown.

Requirements

  • Python 3.10+
  • Zero external dependencies (stdlib only)

License

MIT

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

playbook_md-0.1.0.tar.gz (14.2 kB view details)

Uploaded Source

Built Distribution

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

playbook_md-0.1.0-py3-none-any.whl (13.3 kB view details)

Uploaded Python 3

File details

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

File metadata

  • Download URL: playbook_md-0.1.0.tar.gz
  • Upload date:
  • Size: 14.2 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.2.0 CPython/3.13.7

File hashes

Hashes for playbook_md-0.1.0.tar.gz
Algorithm Hash digest
SHA256 d97e5442ab8245411276ff4ada0d04ef955d76b80312dcfa9d1e719df25b201b
MD5 687b20589c1ffbad9bfb8b71230b050c
BLAKE2b-256 6ca57d77d36da4d9818801813ca6b301d2433739c03182a2db39ffab4407fcf3

See more details on using hashes here.

File details

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

File metadata

  • Download URL: playbook_md-0.1.0-py3-none-any.whl
  • Upload date:
  • Size: 13.3 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.2.0 CPython/3.13.7

File hashes

Hashes for playbook_md-0.1.0-py3-none-any.whl
Algorithm Hash digest
SHA256 575d911a851b4c693d9d37fbf41b14958f14891e378d291874068958d85b847c
MD5 994c4dd70b20cad49d762771d033fa06
BLAKE2b-256 abe975a1b0117105c3b531c26cfa1fe758eac406da53effb24524257e0f420cc

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 Pingdom Monitoring Sentry Error logging StatusPage Status page