qif

package
v0.0.0-...-e053f5d Latest Latest
Warning

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

Go to latest
Published: Dec 21, 2023 License: Apache-2.0 Imports: 8 Imported by: 0

Documentation

Overview

Package qif parses QIF (Quicken Interchange Format) files, which are commonly exported by banks.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type ClearedType

type ClearedType int

ClearedType represents the "cleared" state of a transaction.

const (
	NotCleared ClearedType = iota
	Cleared
	Reconciled
)

type Entry

type Entry struct {
	// Number is a string identifier for the transaction.
	// Sample value: "0224169143028400738398".
	Number string

	// Date is the date of the transaction.
	Date time.Time

	// Amount is the amount of money, in cents.
	// Amount will be negative for withdrawals.
	Amount int

	// Payee is the recipient of the transaction as reported by the bank.
	// Sample value: "WHOLEFDS NOE 10379 SAN FRANCISCOCA".
	Payee string

	// Address is the address of the recipient as reported by the bank.
	// Sample value: "SAN FRANCISCCA".
	Address string

	// Cleared is the status of the transaction, or zero if not present.
	Cleared ClearedType
}

Entry represents a single entry in the ledger.

type Reader

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

func NewReader

func NewReader(r io.Reader) *Reader

NewReader constructs a new Reader for a given io.Reader.

func (*Reader) ReadEntry

func (r *Reader) ReadEntry() (*Entry, error)

ReadEntry reads an Entry from the input, and can be called repeatedly. ReadHeader must be called first. Returns (nil, io.EOF) at the end of the input.

func (*Reader) ReadHeader

func (r *Reader) ReadHeader() (string, error)

ReadHeader reads the header from the input and returns the value, e.g. "CCard". It must be called first when reading.

Jump to

Keyboard shortcuts

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