API Reference
The Python package API is the primary integration surface for agents and workflow runners.
All public functions return JSON-compatible dictionaries. The same result payloads are emitted by the CLI as JSON.
Import from dpawb.api:
from dpawb.api import assess, coverage, compare, prioritize, summarize
from dpawb.api import capabilities, schema, template, vocabulary
Analytical Operations
assess(profile_path: str) -> dict[str, object]
Assess one composition profile and return an assessment_result.
Input:
profile_path: local path to a composition profile YAML file.
The profile may reference local SHACL Turtle files or live URL sources.
coverage(profile_path: str, use_case_path: str) -> dict[str, object]
Assess one use case against one composition profile and return a coverage_result.
Inputs:
profile_path: local path to a composition profile YAML file.use_case_path: local path to one use-case YAML file.
compare(left_assessment_path: str, right_assessment_path: str, alignment_path: str | None = None) -> dict[str, object]
Compare exactly two existing assessment result documents and return a comparison_result.
Inputs:
left_assessment_path: local path to the leftassessment_resultJSON document.right_assessment_path: local path to the rightassessment_resultJSON document.alignment_path: optional local path to an analyst-authored alignment YAML file.
The two assessment results must have the same declared comparison_scope_label.
prioritize(assessment_path: str, comparison_path: str | None = None, coverage_paths: list[str] | None = None) -> dict[str, object]
Rank improvement targets from existing result documents and return a prioritization_result.
Inputs:
assessment_path: local path to oneassessment_resultJSON document.comparison_path: optional local path to onecomparison_resultJSON document.coverage_paths: optional list ofcoverage_resultJSON document paths.
summarize(result_paths: list[str]) -> dict[str, object]
Create a compact deterministic interpretation document from one or more existing result documents.
Input:
result_paths: list of JSON result document paths.
This operation is rule-based. It does not call an AI model.
Discovery Operations
schema(name: str) -> dict[str, object]
Return a bundled JSON Schema as a schema_result.
Common names include:
profileuse_casealignmentassessment_resultcoverage_resultcomparison_resultprioritization_resultsummary_result
vocabulary(name: str) -> dict[str, object]
Return a bundled controlled vocabulary as a vocabulary_result.
Current names:
item_categoriesjoin_kinds
template(name: str) -> dict[str, object]
Return a bundled YAML template as a template_result.
Current names:
profileuse_casealignment
capabilities() -> dict[str, object]
Return a capabilities_result describing the package/CLI command surface.
This is the recommended discovery entry point for AI agents and MCP wrappers.
Agent Usage Pattern
Agents should treat every API call as a deterministic pipeline step:
- Prepare explicit YAML or JSON input files.
- Call one API function.
- Store the returned dictionary as a JSON result document when it is needed by a downstream step.
- Pass stored result paths to downstream operations such as
compare,prioritize, orsummarize.
The API does not perform hidden semantic mapping. Alignment-aware behavior only uses analyst-authored alignment files.