citi

package
v0.0.0-...-c44b651 Latest Latest
Warning

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

Go to latest
Published: Feb 11, 2024 License: BSD-3-Clause Imports: 11 Imported by: 0

README

citi

Citi bank CSV transaction exports don't include cardholder name, but we can get it from the web UI.

Go to the transactions view and select the statement period you want to download. Then you can use some scripts in the devtools interpreter to load all the transactions and their details, and then finally download the html.

scripts

Load all transactions:

TODO: does it really need multiple loads? only mobile maybe?

f = document.querySelector(".footer-message:not(.mobile):not(.ng-star-inserted)")

while (f.textContent == "Load More Transactions") {
    f.click();
    f = document.querySelector(".footer-message:not(.mobile):not(.ng-star-inserted)");
}
do {
	f = document.querySelector(".footer-message:not(.mobile):not(.ng-star-inserted)")
    f.click();
} while (f.textContent == "Load More Transactions");
while (true) {
    f = document.querySelector(".footer-message:not(.mobile):not(.ng-star-inserted)");
	if f.textContent != "Load More Transactions" {
		break
	}

    f.click();
}

Expand all transactions details:

document.querySelectorAll(".transaction-row.desktop.ng-star-inserted > .transaction-description > .cell-wrapper").forEach(tx => tx.click())

Documentation

Index

Constants

This section is empty.

Variables

View Source
var (
	SelectorTxRow     = cascadia.MustCompile(".transaction-row.mobile")
	SelectorTxDesc    = cascadia.MustCompile("td > div > div.body > div.top > div.description")
	SelectorTxAmount  = cascadia.MustCompile("td > div > div.body > div.top > div.amount")
	SelectorTxDetails = cascadia.MustCompile("td.transaction-details-cell > div.transaction-details-wrapper > div.extended-descriptions >  div.extended-description-row")
)

Functions

This section is empty.

Types

type Fields

type Fields struct {
	Card    string
	User    string
	Account string
}

type Parser

type Parser struct{}

implements pfin.Parser interface

func (Parser) Filetype

func (Parser) Filetype() string

func (Parser) Parse

func (Parser) Parse(acc pfin.Account, filename string, data []byte) (txns []pfin.Transaction, err error)

type Raw

type Raw struct {
	Description string
	Amount      float64

	Purchased time.Time
	Posted    time.Time

	Cardmember string
	Method     string
	Category   string
	Rewards    int

	Type string
}

type Transaction

type Transaction struct {
	Fields // computed fields, namespaced so they don't conflict with the interface methods
	Raw    // raw fields from the csv
}

func TxFromHTML

func TxFromHTML(n *html.Node) (tx Transaction, err error)

func (Transaction) Account

func (tx Transaction) Account() string

func (Transaction) Amount

func (tx Transaction) Amount() float64

func (Transaction) Card

func (tx Transaction) Card() string

func (Transaction) Category

func (tx Transaction) Category() string

func (Transaction) Date

func (tx Transaction) Date() time.Time

func (Transaction) Name

func (tx Transaction) Name() string

func (Transaction) String

func (tx Transaction) String() string

should be util.FormatTx

func (Transaction) User

func (tx Transaction) User() string

Jump to

Keyboard shortcuts

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