receipt

package
v1.1.3 Latest Latest
Warning

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

Go to latest
Published: Apr 1, 2026 License: MIT Imports: 11 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Parser

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

Parser handles receipt parsing using the Anthropic Messages API.

func NewParser

func NewParser() *Parser

NewParser creates a new receipt parser using the Anthropic API. It reads the API key from the ANTHROPIC_API_KEY env var.

func NewParserWithKey

func NewParserWithKey(apiKey string) *Parser

NewParserWithKey creates a new receipt parser with an explicit API key. If apiKey is empty, parsing will fail with a descriptive error.

func (*Parser) HasAPIKey

func (p *Parser) HasAPIKey() bool

HasAPIKey returns true if the parser has an API key configured.

func (*Parser) ParseFromBytes

func (p *Parser) ParseFromBytes(ctx context.Context, data []byte, contentType string) (*model.ParsedReceipt, error)

ParseFromBytes parses a receipt from raw bytes.

func (*Parser) ParseFromFile

func (p *Parser) ParseFromFile(ctx context.Context, filePath string) (*model.ParsedReceipt, error)

ParseFromFile parses a receipt from a file path.

Jump to

Keyboard shortcuts

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