parser

package
v0.0.0-...-37de4d1 Latest Latest
Warning

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

Go to latest
Published: May 2, 2026 License: MIT Imports: 10 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func Deduplicate

func Deduplicate(txs []domain.Transaction) []domain.Transaction

Deduplicate removes transactions with identical date+description+amount+currency+bank. This handles overlapping date ranges when loading multiple files from the same bank.

func Load

func Load(path string, parsers []Parser) ([]domain.Transaction, error)

Load opens a file, finds the right parser, and returns transactions.

Types

type BBVA

type BBVA struct{}

func (BBVA) Detect

func (BBVA) Detect(path string, _ []string) bool

Detect claims .xlsx files (BBVA exports as Excel, not CSV).

func (BBVA) Name

func (BBVA) Name() string

func (BBVA) Parse

func (BBVA) Parse(r io.Reader) ([]domain.Transaction, error)

type Parser

type Parser interface {
	Name() string
	// Detect returns true if this parser owns the file.
	// path is the file path (useful for extension checks).
	// header is the first CSV row; nil for non-CSV formats.
	Detect(path string, header []string) bool
	Parse(r io.Reader) ([]domain.Transaction, error)
}

Parser knows how to read one bank's file format.

type Revolut

type Revolut struct{}

func (Revolut) Detect

func (Revolut) Detect(path string, header []string) bool

Detect claims CSV files whose header contains Revolut's date column in either the Spanish ("Fecha de inicio") or English ("Started Date") export.

func (Revolut) Name

func (Revolut) Name() string

func (Revolut) Parse

func (Revolut) Parse(r io.Reader) ([]domain.Transaction, error)

Jump to

Keyboard shortcuts

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