Documentation
ยถ
Index ยถ
Constants ยถ
This section is empty.
Variables ยถ
This section is empty.
Functions ยถ
This section is empty.
Types ยถ
type ClassInfo ยถ
type ClassInfo struct {
Name string `json:"name"`
Description string `json:"description"` // Class docstring
Bases []string `json:"bases,omitempty"`
Decorators []string `json:"decorators,omitempty"`
Methods []MethodInfo `json:"methods"`
Properties []PropertyInfo `json:"properties"`
ClassVars []VariableInfo `json:"class_vars,omitempty"`
IsAbstract bool `json:"is_abstract"`
IsDataclass bool `json:"is_dataclass"`
IsEnum bool `json:"is_enum"` // Inherits from Enum
IsProtocol bool `json:"is_protocol"` // Inherits from Protocol (typing)
IsMixin bool `json:"is_mixin"` // Class name ends with Mixin or used as mixin
Metaclass string `json:"metaclass,omitempty"` // metaclass= argument
Dependencies []string `json:"dependencies,omitempty"` // Classes this class depends on (via type hints, imports)
FilePath string `json:"file_path,omitempty"`
StartLine int `json:"start_line,omitempty"`
EndLine int `json:"end_line,omitempty"`
Code string `json:"code,omitempty"`
}
ClassInfo describes a Python class
type CodeAnalyzer ยถ
type CodeAnalyzer struct {
// contains filtered or unexported fields
}
CodeAnalyzer implements PathAnalyzer for Python
func NewCodeAnalyzer ยถ
func NewCodeAnalyzer() *CodeAnalyzer
NewCodeAnalyzer creates a new Python code analyzer
func NewCodeAnalyzerWithOptions ยถ
func NewCodeAnalyzerWithOptions(includeTests bool) *CodeAnalyzer
NewCodeAnalyzerWithOptions creates a Python code analyzer with options
func (*CodeAnalyzer) AnalyzeFile ยถ
func (ca *CodeAnalyzer) AnalyzeFile(filePath string) ([]codetypes.CodeChunk, error)
AnalyzeFile analyzes a single Python file
func (*CodeAnalyzer) AnalyzePaths ยถ
func (ca *CodeAnalyzer) AnalyzePaths(paths []string) ([]codetypes.CodeChunk, error)
AnalyzePaths implements the PathAnalyzer interface
func (*CodeAnalyzer) GetModules ยถ
func (ca *CodeAnalyzer) GetModules() []*ModuleInfo
GetModules returns the internal module information
type ConstantInfo ยถ
type ConstantInfo struct {
Name string `json:"name"`
Type string `json:"type,omitempty"`
Value string `json:"value"`
Description string `json:"description"`
FilePath string `json:"file_path,omitempty"`
StartLine int `json:"start_line,omitempty"`
EndLine int `json:"end_line,omitempty"`
}
ConstantInfo describes a module-level constant (UPPER_CASE)
type DependencyInfo ยถ
type DependencyInfo struct {
Source string `json:"source"` // Source class/module
Target string `json:"target"` // Target class/module
Type string `json:"type"` // "inheritance", "composition", "import", "type_hint"
References []string `json:"references"` // Specific references (method names, etc.)
}
DependencyInfo represents a dependency relationship between classes/modules
type DocstringArg ยถ
type DocstringArg struct {
Name string `json:"name"`
Type string `json:"type,omitempty"`
Description string `json:"description"`
Default string `json:"default,omitempty"`
Optional bool `json:"optional,omitempty"`
}
DocstringArg represents a parameter/attribute in docstring
type DocstringInfo ยถ
type DocstringInfo struct {
Summary string `json:"summary"`
Description string `json:"description"`
Args []DocstringArg `json:"args,omitempty"`
Returns *DocstringReturn `json:"returns,omitempty"`
Raises []DocstringRaise `json:"raises,omitempty"`
Examples []string `json:"examples,omitempty"`
Attributes []DocstringArg `json:"attributes,omitempty"`
}
DocstringInfo contains parsed docstring information
type DocstringRaise ยถ
DocstringRaise represents an exception that can be raised
type DocstringReturn ยถ
type DocstringReturn struct {
Type string `json:"type,omitempty"`
Description string `json:"description"`
}
DocstringReturn represents return value documentation
type FunctionInfo ยถ
type FunctionInfo struct {
Name string `json:"name"`
Signature string `json:"signature"`
Description string `json:"description"` // Function docstring
Parameters []codetypes.ParamInfo `json:"parameters"`
ReturnType string `json:"return_type,omitempty"`
Returns []codetypes.ReturnInfo `json:"returns,omitempty"`
Decorators []string `json:"decorators,omitempty"`
IsAsync bool `json:"is_async"`
IsGenerator bool `json:"is_generator"`
FilePath string `json:"file_path,omitempty"`
StartLine int `json:"start_line,omitempty"`
EndLine int `json:"end_line,omitempty"`
Code string `json:"code,omitempty"`
}
FunctionInfo describes a module-level function
type ImportInfo ยถ
type ImportInfo struct {
Module string `json:"module"` // Module being imported
Names []string `json:"names,omitempty"` // Specific names imported (from X import a, b)
Alias string `json:"alias,omitempty"` // Import alias (import X as Y)
IsFrom bool `json:"is_from"` // True if "from X import Y"
StartLine int `json:"start_line,omitempty"`
}
ImportInfo describes an import statement
type MethodCall ยถ
type MethodCall struct {
Name string `json:"name"` // Method/function name
Receiver string `json:"receiver,omitempty"` // Object the method is called on (e.g., "self", "cls", variable name)
ClassName string `json:"class_name,omitempty"` // Class name if known
Line int `json:"line,omitempty"` // Line number of the call
}
MethodCall represents a call to another method/function
type MethodInfo ยถ
type MethodInfo struct {
Name string `json:"name"`
Signature string `json:"signature"`
Description string `json:"description"` // Method docstring
Parameters []codetypes.ParamInfo `json:"parameters"`
ReturnType string `json:"return_type,omitempty"`
Returns []codetypes.ReturnInfo `json:"returns,omitempty"`
Decorators []string `json:"decorators,omitempty"`
Calls []MethodCall `json:"calls,omitempty"` // Methods/functions this method calls
TypeDeps []string `json:"type_deps,omitempty"` // Types used in parameters/return
IsStatic bool `json:"is_static"`
IsClassMethod bool `json:"is_classmethod"`
IsProperty bool `json:"is_property"`
IsAbstract bool `json:"is_abstract"`
IsAsync bool `json:"is_async"`
ClassName string `json:"class_name,omitempty"`
FilePath string `json:"file_path,omitempty"`
StartLine int `json:"start_line,omitempty"`
EndLine int `json:"end_line,omitempty"`
Code string `json:"code,omitempty"`
}
MethodInfo describes a class method
type ModuleDependencies ยถ
type ModuleDependencies struct {
ModuleName string `json:"module_name"`
Imports []ImportInfo `json:"imports"`
Dependencies []DependencyInfo `json:"dependencies"`
}
ModuleDependencies contains all dependency information for a module
type ModuleInfo ยถ
type ModuleInfo struct {
Name string `json:"name"` // Module name (e.g., "mypackage.mymodule")
Path string `json:"path"` // File path
Description string `json:"description"` // Module docstring
Classes []ClassInfo `json:"classes"`
Functions []FunctionInfo `json:"functions"`
Constants []ConstantInfo `json:"constants"`
Variables []VariableInfo `json:"variables"`
Imports []ImportInfo `json:"imports"`
}
ModuleInfo contains comprehensive information about a Python module/package
type PropertyInfo ยถ
type PropertyInfo struct {
Name string `json:"name"`
Type string `json:"type,omitempty"` // Type hint if available
Description string `json:"description"`
HasGetter bool `json:"has_getter"`
HasSetter bool `json:"has_setter"`
HasDeleter bool `json:"has_deleter"`
FilePath string `json:"file_path,omitempty"`
StartLine int `json:"start_line,omitempty"`
EndLine int `json:"end_line,omitempty"`
}
PropertyInfo describes a class property (using @property decorator)
type VariableInfo ยถ
type VariableInfo struct {
Name string `json:"name"`
Type string `json:"type,omitempty"` // Type annotation if available
Value string `json:"value,omitempty"`
Description string `json:"description"`
IsConstant bool `json:"is_constant"` // UPPER_CASE naming convention
FilePath string `json:"file_path,omitempty"`
StartLine int `json:"start_line,omitempty"`
EndLine int `json:"end_line,omitempty"`
}
VariableInfo describes a module-level or class variable