Help us shape the future of Go! Take the 2026 Go Developer Survey

pycollector

package module
v0.0.0-...-762485d Latest Latest
Warning

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

Go to latest
Published: Oct 27, 2026 License: AGPL-3.0 Imports: 8 Imported by: 0

Documentation

Overview

Package pycollector implements the Collector interface for Python projects. Supported frameworks: FastAPI, Django REST Framework, Flask.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func New

func New() collector.Collector

Types

type PythonCollector

type PythonCollector struct {
	// contains filtered or unexported fields
}

PythonCollector parses Python source trees for API route definitions.

func (*PythonCollector) Collect

func (c *PythonCollector) Collect(ctx collector.CollectContext) ([]collector.ApiEndpoint, error)

Collect walks the source directory and extracts endpoints from FastAPI, Django REST, and Flask sources. Each framework parser is invoked concurrently. Results are merged into a single slice. If a parser returns an error, a warning is logged and collection continues with the remaining parsers.

func (*PythonCollector) DependencyResolution

func (c *PythonCollector) DependencyResolution() collector.DependencyResolution

DependencyResolution reports whether dependency-based type resolution ran during the last Collect call, and why not when it did not.

func (*PythonCollector) Frameworks

func (c *PythonCollector) Frameworks() []string

Frameworks reports the frameworks the last Collect call found endpoints for.

func (*PythonCollector) Name

func (c *PythonCollector) Name() string

func (*PythonCollector) SetDependencyResolver

func (c *PythonCollector) SetDependencyResolver(dr collector.DependencyResolver)

func (*PythonCollector) SupportedLanguages

func (c *PythonCollector) SupportedLanguages() []string

func (*PythonCollector) Unresolved

func (c *PythonCollector) Unresolved() map[string]int

Unresolved reports type names the framework resolvers could not expand during the last Collect call, mapped to occurrence counts.

type PythonDependencyResolver

type PythonDependencyResolver struct {
	// contains filtered or unexported fields
}

func NewPythonDependencyResolver

func NewPythonDependencyResolver(sourceDir string) *PythonDependencyResolver

func (*PythonDependencyResolver) DetectDependencies

func (r *PythonDependencyResolver) DetectDependencies(sourceDir string) ([]collector.Dependency, error)

func (*PythonDependencyResolver) ResolveType

func (r *PythonDependencyResolver) ResolveType(typeName string) *collector.ResolvedType

func (*PythonDependencyResolver) ResolvedCount

func (r *PythonDependencyResolver) ResolvedCount() int

ResolvedCount reports how many distinct requested types were answered from dependency packages so far.

Directories

Path Synopsis
Package django parses Django REST Framework views and URL patterns.
Package django parses Django REST Framework views and URL patterns.
Package fastapi parses FastAPI decorated route functions using tree-sitter-python.
Package fastapi parses FastAPI decorated route functions using tree-sitter-python.

Jump to

Keyboard shortcuts

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