Skip to content

Overview

Overview

What this page is: A high-level tour of COGANT's stable Python API surface — Session, PipelineRunner, Bundle, and ReviewAPI.

Prerequisites: Installation and a brief skim of Tutorial 1: Quickstart.

Reading time: ~8 minutes

Next steps: Quick Start · Session API · PipelineRunner API

The COGANT Python API provides high-level interfaces for codebase analysis and GNN translation. The main classes are:

  • Session: Manages pipeline state and intermediate results
  • PipelineRunner: Orchestrates all analysis stages
  • Bundle: Wraps analysis artifacts with convenient accessors
  • ReviewAPI: Interactive curation and review interface

Session method index

Public methods on Session (use in order for a manual pipeline):

Method Section
Session.from_target (classmethod) Creating a Session
extract_static() Extracting Analysis
extract_dynamic(...) Extracting Analysis
build_graph() Building Program Graph
translate_to_gnn() Translating to GNN
compile_state_space() Compiling State Space
export_all(output_dir, layout=False) Exporting Results

These headings anchor the table above; for narrative detail see Quick Start and the source in py/cogant/api/session.py.

Creating a Session

Construct with Session.from_target(path) after configuration is available.

Extracting Analysis

extract_static() and optional extract_dynamic(...) populate repo and trace facts used by later stages.

Building Program Graph

build_graph() materializes the typed program graph IR.

Translating to GNN

translate_to_gnn() runs the semantic rule engine over the graph.

Compiling State Space

compile_state_space() builds state-space variables from semantic mappings.

Exporting Results

export_all(output_dir, layout=False) writes bundles, GNN artifacts, and optional layout outputs.

Examples

Public classes documented above (Session, PipelineRunner, Bundle, ReviewAPI) are exercised by the following: