ynab.cr
Version, currently 0.2.02 versions
- 0.2.0latestJun 17, 2019
- 0.1.0not indexedJan 26, 2021
github.com/jaredsmithse/ynab.cr
YNAB Shard for Crystal
Installation
# Add this to your shard.yml
dependencies:
ynab.cr:
github: jaredsmithse/ynab.cr
version: ~> 0.2.0Then run:
shards installshard.yml
- Crystal
0.29.0- License
- MIT
- Author
- Jared Smith
Dependencies
Development Dependencies
README
ynab
This is an API client for YNAB. It has most of the basic operations for fetching your data from YNAB. See the issues for this project for missing functionality. The primary functionality that still needs implementation is Delta Requests.
Installation
Add this to your application's shard.yml:
dependencies:
ynab:
github: jaredsmithse/ynab
Usage
The YNAB API has two base objects, Budget and User. User has no other nested resources, while every other resource is nested under Budget. If you have a budget_id you can initialize the resource you want directly. All available resources are in the ./src/api/ folder.
Examples
Configuration
Instructions for obtaining your own API token can be found on the YNAB website here.
require "ynab"
YNAB::Client.configure do |settings|
settings.access_token = ynab_api_token
settings.base_url = "https://api.youneedabudget.com/v1/"
end
client = YNAB::Client
Getting All Budgets For An Account
client = YNAB::Client
budgets = client.budgets.get_all.each do |budget|
puts budget.name
end
Working With Resources For A Budget
client = YNAB::Client
# Get a list of accounts with a pre-fetched budget_id
budgets = client.budgets.get_all
# you can alternatively do budgets.first.accounts.get_all
accounts = client.accounts(budgets.first.id).get_all
accounts.each { |account| "#{account.name}: $#{account.balance / 100}" }
# Find how many times you use Lyft every month
transactions = budgets.first.transactions.get_all
transactions.
select { |txn| txn.payee_name == "Lyft" }.
group_by { |txn| "#{txn.date.year}-#{txn.date.month}" }.
transform_values(&.size)
Development
For development, you will need a personal access token from YNAB. You can find instructions on how to get one for your account here.
Contributing
- Fork it (https://github.com/your-github-user/ynab/fork)
- Create your feature branch (
git checkout -b my-new-feature) - Commit your changes (
git commit -am 'Add some feature') - Push to the branch (
git push origin my-new-feature) - Create a new Pull Request
Contributors
- @jaredsmithse Jared Smith - creator, maintainer
Documentation
Built from the current release. The first visit to a release nobody has asked for starts its build.
Links
This release
- Version
0.2.0- Tagged
- Jun 17, 2019
- Commit
e834666a2f52- Crystal
0.29.0- Indexed
- yes
Dependents
No indexed shard depends on this one yet.
Repository
github.com/jaredsmithse/ynab.cr
Metadata
- Created
- Aug 12, 2026
- Updated
- Aug 14, 2026
- Synced
- Aug 14, 2026
- Versions
- 2