Documentation
¶
Overview ¶
Package pycollector implements the Collector interface for Python projects. Supported frameworks: FastAPI, Django REST Framework, Flask.
Index ¶
- func New() collector.Collector
- type PythonCollector
- func (c *PythonCollector) Collect(ctx collector.CollectContext) ([]collector.ApiEndpoint, error)
- func (c *PythonCollector) DependencyResolution() collector.DependencyResolution
- func (c *PythonCollector) Frameworks() []string
- func (c *PythonCollector) Name() string
- func (c *PythonCollector) SetDependencyResolver(dr collector.DependencyResolver)
- func (c *PythonCollector) SupportedLanguages() []string
- func (c *PythonCollector) Unresolved() map[string]int
- type PythonDependencyResolver
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
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. |