Documentation
¶
Overview ¶
Package python contains Python-specific source inspection, signature extraction, and NFlow assets.
Index ¶
- func AssetFiles() fs.FS
- func ExtractSignatures(src []byte, exportedOnly bool) (snippets []string, funcCount int, err error)
- func Inspect(ctx context.Context, source, className string, options InspectOptions) ([]contract.Contract, error)
- func IsTag(tag string) bool
- func NFlowFiles() fs.FS
- func ReadBlockBody(c *compiler.Parser) (string, error)
- type InspectOptions
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func AssetFiles ¶
AssetFiles returns Python's embedded runner profiles and source templates, rooted at profiles/ and templates/.
func ExtractSignatures ¶
ExtractSignatures parses Python source and emits function and class signatures.
func Inspect ¶
func Inspect(ctx context.Context, source, className string, options InspectOptions) ([]contract.Contract, error)
Inspect parses Python dataclasses and TypedDict declarations into the language-neutral contract model. If className is non-empty, only that class is returned; otherwise all supported top-level classes are inspected.
func NFlowFiles ¶
NFlowFiles exposes Python-specific examples rooted at "nflows/".
func ReadBlockBody ¶
ReadBlockBody scans Python source directly, rather than relying on Flow's host lexer for comment and string boundaries. Braces in comments, ordinary strings, triple-quoted strings, and f-strings do not close the outer block.
Types ¶
type InspectOptions ¶
type InspectOptions struct {
PythonCommand string
}
InspectOptions configures the Python interpreter used only to run the standard-library AST parser. Input modules themselves are never executed.