ConnorGriffin / Posh-YNAB

YNAB API Implementation in PowerShell
MIT License
15 stars 7 forks source link

Posh-YNAB

Build status PSG Version PSG Downloads

YNAB API Implementation in PowerShell.

This module is available on the PowerShell Gallery.

Initial setup

Installing and loading the module

# Install the module (if you have PowerShell 5, or the PowerShellGet module).
Install-Module Posh-YNAB -Scope CurrentUser

# Import the module.
Import-Module Posh-YNAB

# Get commands in the module
Get-Command -Module Posh-YNAB

# Get help for a specific command
Get-Help Add-YnabTransaction -Full

Getting your YNAB API Token

Head on over to YNAB's Personal Access Tokens page for instructions on generating a token.

Configuring defaults

Your budget name and API token can be stored as defaults that load when the module loads, so you do not need to specify these every time. The API token is stored as a SecureString, which can only be decrypted by the user and computer that encrypted it. The Token cannot be decrypted by any other user on your computer, or any user (including yourself) on any other computer.

# Set your default Budget and Token (example token generated randomly)
Set-YnabDefault -Budget "Test Budget" -Token 'c63d41ca37bc03e4837d2e7cacc60ee9ac63432f3bbf2f3deced75449afb5185'

# Test the defaults by getting a list of categories from your budget without actually providing the -Budget or -Token parameters
Get-YnabCategory

Usage

Some things to note:

Posting a transaction

# Add a transaction
Add-YnabTransaction -Budget 'Test Budget' -Account 'Checking' -Payee 'School' -Category 'Education' -Memo 'Enrollment Fee' -Outflow 500

Date                 Amount Memo           Cleared   Approved FlagColor Payee  Category  Account
----                 ------ ----           -------   -------- --------- -----  --------  -------
6/4/2018 12:00:00 AM -500   Enrollment Fee uncleared True               School Education Checking

Current Progress

To Do

In Progress

Done

Endpoint Progress

Attempting to implement functionality for all endpoints listed here, as of 2018-04-04.

User

Budgets

Accounts

The Accounts for a budget.

Categories

The Categories for a budget.

Payees

The Payees for a budget.

Payee Locations

When you enter a transaction and specify a payee on the YNAB mobile apps, the GPS coordinates for that location are stored, with your permission, so that the next time you are in the same place (like the Grocery store) we can pre-populate nearby payees for you! It’s handy and saves you time. This resource makes these locations available. Locations will not be available for all payees.

Months

Each budget contains one or more months, which is where To be Budgeted, Age of Money and Category (budgeted / activity / balances) amounts are available.

Transactions

The Transactions for a budget.

Scheduled Transactions

The Scheduled Transactions for a budget.