Skip to content

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

  1. 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.

  2. 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.).

  3. 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.

  4. 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.

  5. Cookbook recipes — Pick the recipes that match what you need to do:

  6. 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