Public
Edited
Mar 15
1 fork
Insert cell
Insert cell
Insert cell
html`Download <a href="data:text/csv;base64,${base64.toBase64(ynab_csv)}" download="${ynab_file_name}">${ynab_file_name}</a>`
Insert cell
Insert cell
guessed_owner_name = {
const name_tallies = venmo_statements
.map(s => [s.From, s.To])
.flat()
.reduce((tally, name) => Object.assign(tally, {[name]: (tally[name] || 0) + 1}), {})
const [most_popular, count] = Object.entries(name_tallies).sort((n1, n2) => n2[1] - n1[1])[0]
return most_popular
}
Insert cell
ynab_csv = papa.unparse(ynab_statements)
Insert cell
ynab_statements = {
// Format defined by https://docs.youneedabudget.com/article/921-formatting-csv-file
return venmo_statements.map(s => ({
Date: new Date(s.Datetime).toLocaleDateString("en-US"),
Payee: [s.From, s.To].filter(i => i != guessed_owner_name)[0] || s.Destination,
Memo: s.Note,
Amount: s["Amount (total)"].replace(/\+? \$/, ""),
}))
}
Insert cell
Insert cell
Insert cell
Insert cell
Insert cell
papa = import("https://cdn.skypack.dev/papaparse@5.3.1")
Insert cell
Insert cell

Purpose-built for displays of data

Observable is your go-to platform for exploring data and creating expressive data visualizations. Use reactive JavaScript notebooks for prototyping and a collaborative canvas for visual data exploration and dashboard creation.
Learn more