pycode

package
v1.1.9 Latest Latest
Warning

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

Go to latest
Published: Apr 6, 2026 License: MIT Imports: 9 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type PycodeStreamParser

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

PycodeStreamParser implements the core.Parser interface for Python code files

func DefaultPycodeStreamParser added in v1.1.3

func DefaultPycodeStreamParser() *PycodeStreamParser

DefaultPycodeStreamParser creates a new Python code stream parser

func (*PycodeStreamParser) GetSupportedTypes

func (p *PycodeStreamParser) GetSupportedTypes() []string

GetSupportedTypes returns the supported formats

func (*PycodeStreamParser) Parse

func (p *PycodeStreamParser) Parse(ctx context.Context, content []byte, metadata map[string]any) (*core.Document, error)

Parse implements core.Parser interface.

func (*PycodeStreamParser) ParseStream

func (p *PycodeStreamParser) ParseStream(ctx context.Context, r io.Reader, metadata map[string]any) (<-chan *core.Document, error)

ParseStream parses Python code from a reader and returns a channel of documents

func (*PycodeStreamParser) SetChunkOverlap

func (p *PycodeStreamParser) SetChunkOverlap(overlap int)

SetChunkOverlap sets the chunk overlap

func (*PycodeStreamParser) SetChunkSize

func (p *PycodeStreamParser) SetChunkSize(size int)

SetChunkSize sets the chunk size

func (*PycodeStreamParser) SetExtractClasses

func (p *PycodeStreamParser) SetExtractClasses(extract bool)

SetExtractClasses sets whether to extract classes

func (*PycodeStreamParser) SetExtractComments

func (p *PycodeStreamParser) SetExtractComments(extract bool)

SetExtractComments sets whether to extract comments

func (*PycodeStreamParser) SetExtractFunctions

func (p *PycodeStreamParser) SetExtractFunctions(extract bool)

SetExtractFunctions sets whether to extract functions

func (*PycodeStreamParser) Supports

func (p *PycodeStreamParser) Supports(contentType string) bool

Jump to

Keyboard shortcuts

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