API Consumer — Learning Path
You want to drive COGANT from Python code, embed it inside your own pipeline, or build a service around it. This path takes you from "I've installed the package" to "I'm calling the runner with a custom config and handling errors gracefully".
Estimated reading time: ~90 minutes. Estimated hands-on time: ~2 hours.
Steps
-
Quick Start (CLI) — Even if you'll never use the CLI in production, run it once. The CLI is a thin wrapper over the same API you'll be calling, and seeing the canonical sequence of stages helps everything that follows make sense.
-
API Reference Overview — Map of the public Python surface: which modules are stable, which are internal, and how the package is laid out (
cogant.translate,cogant.reverse,cogant.runtime, etc.). -
API Quick Start — The minimum amount of code needed to translate a repository into a GNN from inside Python. Copy this into a scratch script and run it before continuing.
-
PipelineRunner API — The recommended high-level entry point. Covers how to construct a runner, supply a config, stream stage events, and collect results. Most production integrations should go through this.
-
Cookbook recipes — Pick the recipes that match what you need to do:
- Scan a Repo — basic invocation
- JSON Output — machine-readable results
- Custom Threshold — tuning scoring
- Multi-Project — batching across repos
- CI Integration — wiring into a pipeline
- Batch Scan — many repos, one job
- Incremental — re-running only what changed
-
Error Handling — The exception hierarchy COGANT raises, what each error means, and how to recover or surface it to your users. Read this before you ship — it's the difference between a robust integration and one that swallows useful diagnostics.
Where to go next
- For performance tuning, see the Performance Tips page and the Benchmarks roadmap.
- For debugging stuck pipelines, see Debugging.
- For a complete end-to-end example, see Complete Example.
- If you need to extend the rule set or add a new exporter, switch to the Plugin Author path.