python

package
v1.1.0 Latest Latest
Warning

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

Go to latest
Published: Mar 5, 2026 License: MIT Imports: 7 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Generator

type Generator struct {
	Report  analyzer.Report
	Files   map[string]string
	BaseDir string
}

Generator handles Python code generation

func New

func New(report analyzer.Report) *Generator

New creates a new Python code generator

func (*Generator) Generate

func (g *Generator) Generate() (string, error)

Generate generates Python code for all transactions and scripts

func (*Generator) SetBaseDir

func (g *Generator) SetBaseDir(dir string)

SetBaseDir sets the base directory for reading files

type PyField

type PyField struct {
	Name     string
	Type     string
	Optional bool
}

PyField represents a field in a Python dataclass

type PyFunction

type PyFunction struct {
	Name       string
	ClassName  string
	Parameters []PyParameter
	ReturnType string
	Base64     string
	Type       string // "transaction" or "script"
}

PyFunction represents a function in the generated code

type PyParameter

type PyParameter struct {
	Name     string
	Type     string
	Optional bool
}

PyParameter represents a parameter in Python

type PyStruct

type PyStruct struct {
	Name           string
	RequiredFields []PyField
	OptionalFields []PyField
}

PyStruct represents a dataclass in Python

Jump to

Keyboard shortcuts

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