python

package
v0.4.2 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: May 14, 2026 License: MIT Imports: 6 Imported by: 0

Documentation

Overview

Package python implements the Python language extractor.

Mirrors src/main/java/.../intelligence/extractor/python/PythonLanguageExtractor.java using the tree-sitter Python grammar.

Capabilities:

  • METHOD nodes: emit CALLS edges for call nodes inside the matching function_definition.
  • CLASS nodes: emit `extends_type` type-hint from the first superclass.
  • MODULE nodes: emit `all_exports` type-hint from a top-level __all__ list (regex-matched on the source — fast and correct for the common module-level form).

Confidence: PARTIAL.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Extractor

type Extractor struct{}

Extractor implements LanguageExtractor for Python. Stateless.

func New

func New() *Extractor

New returns a Python extractor.

func (*Extractor) Extract

func (e *Extractor) Extract(ctx extractor.Context, node *model.CodeNode) extractor.Result

Extract dispatches by node kind. Single-node convenience wrapper; parses the file each call. Production paths use ExtractFromTree to amortise the parse across every node in a file.

func (*Extractor) ExtractFromTree

func (e *Extractor) ExtractFromTree(ctx extractor.Context, tree *parser.Tree, nodes []*model.CodeNode) []extractor.Result

ExtractFromTree walks a single pre-parsed tree once and produces a Result per input node. Order matches `nodes`. tree may be nil — every node maps to EmptyResult in that case.

func (*Extractor) Language

func (e *Extractor) Language() string

Language returns "python".

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL