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
Release history Release notifications | RSS feed
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)
Built Distribution
Filter files by name, interpreter, ABI, and platform.
If you're not sure about the file name format, learn more about wheel file names.
Copy a direct link to the current filters
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
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
d97e5442ab8245411276ff4ada0d04ef955d76b80312dcfa9d1e719df25b201b
|
|
| MD5 |
687b20589c1ffbad9bfb8b71230b050c
|
|
| BLAKE2b-256 |
6ca57d77d36da4d9818801813ca6b301d2433739c03182a2db39ffab4407fcf3
|
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
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
575d911a851b4c693d9d37fbf41b14958f14891e378d291874068958d85b847c
|
|
| MD5 |
994c4dd70b20cad49d762771d033fa06
|
|
| BLAKE2b-256 |
abe975a1b0117105c3b531c26cfa1fe758eac406da53effb24524257e0f420cc
|