python

package
v1.0.0 Latest Latest
Warning

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

Go to latest
Published: Jan 17, 2026 License: MIT Imports: 9 Imported by: 0

Documentation

Overview

Package python implements the Python protobuf compiler.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Compiler

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

Compiler implements the compiler.Compiler interface for Python

func New

func New(log *logger.Logger, opts *Options) *Compiler

New creates a new Python compiler

func (*Compiler) Compile

Compile compiles the given proto files to Python

func (*Compiler) GetOutputPath

func (c *Compiler) GetOutputPath(file compiler.ProtoFile, opts compiler.CompileOptions) string

GetOutputPath returns the output path for a proto file

func (*Compiler) Name

func (c *Compiler) Name() string

Name returns the compiler name

func (*Compiler) RequiredTools

func (c *Compiler) RequiredTools() []string

RequiredTools returns the list of required external tools

func (*Compiler) Validate

func (c *Compiler) Validate() error

Validate checks if the compiler is properly configured

type Options

type Options struct {
	// ProtocPath is the path to the protoc binary
	ProtocPath string

	// GrpcPythonPluginPath is the path to the grpc_python_plugin
	GrpcPythonPluginPath string

	// GenerateGrpc enables gRPC code generation
	GenerateGrpc bool

	// GenerateTyping enables .pyi stub file generation
	GenerateTyping bool

	// GenerateInit enables __init__.py generation
	GenerateInit bool

	// PythonPackagePrefix is the Python package prefix for imports
	PythonPackagePrefix string
}

Options contains Python-specific compilation options

func DefaultOptions

func DefaultOptions() *Options

DefaultOptions returns default options for Python compiler

Jump to

Keyboard shortcuts

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