Code Monkey home page Code Monkey logo

ynab-sdk-ruby's Introduction

YNAB API Ruby Library

Build Status Gem Version

This is the Ruby client for the YNAB API.

Please read the YNAB API documentation for an overview of using the API and a complete list of available resources.

This client is generated using the Swagger Code Generator.

Installation

gem install ynab

Usage

To use this client you must obtain an access token from your My Account page of the YNAB web app.

require 'ynab'

access_token = ENV['YNAB_ACCESS_TOKEN']
ynab_api = YNAB::API.new(access_token)

budget_response = ynab_api.budgets.get_budgets
budgets = budget_response.data.budgets

budgets.each do |budget|
  puts "Budget Name: #{budget.name}"
end

Examples

See the examples folder for example usage scenarios.

Methods

The following methods are available in this library.

Method Description
User user.get_user() Returns authenticated user information
Budgets budgets.get_budgets() Returns budgets list with summary information
budgets.get_budget_by_id(budget_id) Returns a single budget with all related entities
budgets.get_budget_settings_by_id(budget_id) Returns settings for a budget
Accounts accounts.get_accounts(budget_id) Returns all accounts
accounts.get_account_by_id(budget_id, account_id) Returns a single account
Categories categories.get_categories(budget_id) Returns all categories grouped by category group.
categories.get_category_by_id(budget_id, category_id) Returns a single category
Payees payees.get_payees(budget_id) Returns all payees
payees.get_payee_by_id(budget_id, payee_id) Returns single payee
Payee Locations payee_locations.get_payee_locations(budget_id) Returns all payee locations
payee_locations.get_payee_location_by_id(budget_id, payee_location_id) Returns a single payee location
payee_locations.get_payee_locations_by_payee(budget_id, payee_id) Returns all payee locations for the specified payee
Months months.get_budget_months(budget_id) Returns all budget months
months.get_budget_month(budget_id, month) Returns a single budget month
months.get_month_category_by_id(budget_id, month, category_id) Returns a single category for a specific budget month
months.update_month_category(budget_id, month, category_id, month_category) Update an existing month category
Transactions transactions.get_transactions(budget_id) Returns budget transactions
transactions.get_transactions_by_account(budget_id, account_id) Returns all transactions for a specified account
transactions.get_transactions_by_category(budget_id, category_id) Returns all transactions for a specified category
transactions.get_transaction_by_id(budget_id, transaction_id) Returns a single transaction
transactions.update_transaction(budget_id, id, transaction) Updates a transaction
transactions.create_transaction(budget_id, save_transactions) Creates one transaction
transactions.create_transactions(budget_id, save_transactions) Creates multiple transactions
transactions.bulk_create_transactions(budget_id, transactions) Creates multiple transactions
Scheduled Transactions scheduled_transactions.get_scheduled_transactions(budget_id) Returns all scheduled transactions
scheduled_transactions.get_scheduled_transaction_by_id(budget_id, scheduled_transaction_id) Returns a single scheduled transaction

Development

  • Install dependencies: bundle
  • Generate latest client based on swagger spec: rake generate
  • Run tests: rake spec or rspec

Releasing

  • Commit all changes
  • Bump VERSION in lib/ynab/version.rb
  • Run rake publish to publish to RubyGems

License

Copyright (c) 2018 You Need A Budget, LLC

Licensed under the Apache-2.0 license

ynab-sdk-ruby's People

Contributors

bradymholt avatar unpublishedworks avatar georgep-slalom avatar arthurnn avatar

Watchers

James Cloos avatar Douglas Jones avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.