pyextract

package
v1.10.7 Latest Latest
Warning

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

Go to latest
Published: May 5, 2026 License: MIT Imports: 8 Imported by: 0 modules, 0 packages

The first number is the count of modules that contain a package that imports this one. The module count is a better indicator of popularity than the package count. A module with 100 importing packages is counted only once instead of 100 times, reflecting the fact that the choice to use the package was likely made only once, not 100 times.
A '?' means that the value hasn't been computed yet.

Documentation

Overview

Package pyextract is the per-language tree-sitter extraction provider for Python. Mirrors goextract / tsextract: constructor-injected GrammarRegistry, embedded queries.scm, no init() registration.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func NewProvider

func NewProvider(grammars *treesitter.GrammarRegistry) extract.Provider

NewProvider compiles the embedded queries against the injected GrammarRegistry's "python" grammar. Panics on missing grammar or query compile failure.

Types

type Provider

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

Provider is the concrete Python extraction provider.

func (*Provider) Extensions

func (p *Provider) Extensions() []string

func (*Provider) Extract

func (p *Provider) Extract(ctx context.Context, source []byte, file extract.SourceFile) (*extract.ExtractedFile, error)

Extract parses the source bytes and returns an ExtractedFile per the Phase 59 P02 fact contract. Decorator presence is captured as a reference, NOT folded into the symbol's stable-ID input — Python decorator add/remove preserves ID per CONTEXT.md D-03.

func (*Provider) Language

func (p *Provider) Language() string

func (*Provider) Queries

func (p *Provider) Queries() string

func (*Provider) SupportsLSPEnrichment

func (p *Provider) SupportsLSPEnrichment() bool

func (*Provider) TreeSitterLanguage

func (p *Provider) TreeSitterLanguage() *tree_sitter.Language

Jump to

Keyboard shortcuts

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