python

package
v0.4.9 Latest Latest
Warning

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

Go to latest
Published: Feb 24, 2026 License: MIT Imports: 12 Imported by: 0

Documentation

Overview

Package python implements a gorisk analyzer for Python projects. It supports pyproject.toml/poetry.lock, Pipfile.lock, and requirements.txt.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func BuildIRGraph added in v0.4.2

func BuildIRGraph(g *graph.DependencyGraph) ir.IRGraph

BuildIRGraph builds a function-level IR graph for a Python dependency graph.

func Detect

func Detect(dir string) capability.CapabilitySet

Detect walks .py files in dir and returns the combined capability set.

func DetectFunctions added in v0.4.2

func DetectFunctions(dir, pkgName string, files []string) (map[string]ir.FunctionCaps, []ir.CallEdge, error)

DetectFunctions parses Python files and returns per-function capability sets and call edges.

Types

type Adapter

type Adapter struct{}

Adapter implements the analyzer.Analyzer interface for Python projects.

func (*Adapter) Load

func (a *Adapter) Load(dir string) (*graph.DependencyGraph, error)

Load parses the Python dependency lockfile in dir, detects capabilities from each installed package's source (if site-packages is present), and returns a *graph.DependencyGraph.

func (*Adapter) Name

func (a *Adapter) Name() string

type PythonPackage

type PythonPackage struct {
	Name         string
	Version      string
	Dir          string // path to site-packages/<name>; empty if not installed
	Dependencies []string
	Direct       bool
}

PythonPackage represents a Python dependency extracted from a lockfile.

func Load

func Load(dir string) (pkgs []PythonPackage, retErr error)

Load detects and parses the Python dependency lockfile in dir. Detection order: pyproject.toml+poetry.lock → Pipfile.lock → requirements.txt Load never panics; it returns a structured error on failure.

Jump to

Keyboard shortcuts

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