ynab-go

module
v0.0.0-...-abfe6d4 Latest Latest
Warning

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

Go to latest
Published: May 9, 2018 License: MIT

README

Go YNAB Client

Unofficial Golang client library for the YNAB API.

Example Usage


accessToken := "foobar"
client := ynab.NewDefaultClient(accessToken)

budgets, _ := client.BudgetService.List()
for _, budgetSummary := range budgets {
    fmt.Printf("Budget %v: %v\n", budgetSummary.Id, budgetSummary.Name)

    budget, _ := client.BudgetService.Get(budgetSummary.Id)

    fmt.Printf("Accounts:\n")
    for _, account := range budget.Accounts {
        fmt.Printf("\tAccount %v: %v\n", account.Id, account.Name)
        fmt.Printf("\t\tBalance: %v\n", account.Balance)

        transactions, _ := client.TransactionsService.GetByAccount(budgetSummary.Id, account.Id)

        fmt.Printf("\t\tTransactions:\n")
        for _, transaction := range transactions {
            fmt.Printf("\t\t\t%v: %v\n", transaction.Date, transaction.Amount)
        }
    }
}

Directories

Path Synopsis

Jump to

Keyboard shortcuts

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