python

package
v0.15.0 Latest Latest
Warning

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

Go to latest
Published: Feb 12, 2026 License: AGPL-3.0 Imports: 10 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func IsTestFile

func IsTestFile(filePath string) bool

IsTestFile reports whether the given Python path is a test file.

func ResolvePythonAbsoluteImportPath

func ResolvePythonAbsoluteImportPath(importPath string, suppliedFiles map[string]bool) []string

ResolvePythonAbsoluteImportPath resolves an absolute Python package import (e.g. "dexter.tools.finance.api") to matching project files.

func ResolvePythonImportPath

func ResolvePythonImportPath(sourceFile, importPath string, suppliedFiles map[string]bool) []string

ResolvePythonImportPath resolves a Python import path to possible file paths.

func ResolvePythonProjectImports

func ResolvePythonProjectImports(
	absPath string,
	filePath string,
	ext string,
	suppliedFiles map[string]bool,
	contentReader vcs.ContentReader,
) ([]string, error)

Types

type ExternalImport

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

ExternalImport represents an external module import.

func (ExternalImport) IsTypeOnly

func (e ExternalImport) IsTypeOnly() bool

func (ExternalImport) Path

func (e ExternalImport) Path() string

type InternalImport

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

InternalImport represents a relative module import.

func (InternalImport) IsTypeOnly

func (i InternalImport) IsTypeOnly() bool

func (InternalImport) Path

func (i InternalImport) Path() string

type Module

type Module struct{}

func (Module) Extensions

func (Module) Extensions() []string

func (Module) IsTestFile

func (Module) IsTestFile(filePath string, _ vcs.ContentReader) bool

func (Module) Maturity

func (Module) Maturity() moduleapi.MaturityLevel

func (Module) Name

func (Module) Name() string

func (Module) NewResolver

func (Module) NewResolver(ctx *moduleapi.Context, contentReader vcs.ContentReader) moduleapi.Resolver

type PythonImport

type PythonImport interface {
	Path() string
	IsTypeOnly() bool
}

PythonImport represents an import in a Python file.

func ParsePythonImports

func ParsePythonImports(sourceCode []byte) ([]PythonImport, error)

ParsePythonImports parses Python source code and extracts imports.

func PythonImports

func PythonImports(filePath string) ([]PythonImport, error)

PythonImports parses a Python file and returns its imports.

Jump to

Keyboard shortcuts

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