0.0
No release in over 3 years
Low commit activity in last 3 years
Aspire Budget is a free zero-based envelope-style budgeting spreadsheet built with Google Sheets by Matthew Alcorn. This gem aims to provide an expressive Ruby interface to it.
2005
2006
2007
2008
2009
2010
2011
2012
2013
2014
2015
2016
2017
2018
2019
2020
2021
2022
2023
2024
 Dependencies

Development

>= 0
~> 3.9.0
~> 13.0
~> 3.0
~> 0.89.1
~> 1.42.0
~> 0.17.0

Runtime

 Project Readme

Aspire Budget - Ruby

CI Status Ruby Style Guide

Maintainability Test Coverage

This is an independent project implementing a Ruby for Aspire Budgeting spreadsheets, leveraging from the use of another great gem: google_drive. The idea of this gem is to enable a good API to be easily implemented, allowing more powerful and complex tools to emerge.

If you don't know Aspire Budgeting please refer to: https://aspirebudget.com/

Installation

$ gem install aspire_budget

Usage

Either have an initializer with your config:

# Use this method if you plan to work on a single spreadsheet with your application
AspireBudget.configure do |config|
  config.session = GoogleDrive.from_config('path_to_your_credentials.json')
  config.spreadsheet_key = 'YOUR_SPREADSHEET_KEY'
end

Or specify the config when initializing a worksheet like below.

# Use this method if you plan working with multiple spreadsheets with your application
AspireBudget::Worksheets::Transactions.new(
  session: GoogleDrive.from_config('path_to_your_credentials.json'),
  spreadsheet_key: 'YOUR_SPREADSHEET_KEY'
)

List transactions:

# or AspireBudget::Worksheets::Transactions.new(...).all
AspireBudget::Worksheets::Transactions.all
=> #[<AspireBudget::Models::Transaction:0x0000564acc1ae088
#    @account="Revolut",
#    @category="Groceries",
#    @date=#<Date: 2020-05-31 ((2459001j,0s,0n),+0s,2299161j)>,
#    @inflow=0.0,
#    @memo="Tesco",
#    @outflow=22.51,
#    @status=:approved>,
#   <AspireBudget::Models::Transaction:0x0000564acc1541a0
#    @account="Revolut",
#    @category="Electric Bill",
#    @date=#<Date: 2020-06-22 ((2459023j,0s,0n),+0s,2299161j)>,
#    @inflow=0.0,
#    @memo="Amazon",
#    @outflow=21.54,
#    @status=:approved>]

Insert transaction:

# or AspireBudget::Worksheets::Transactions.new(...).all
# you can also pass a Transaction record instead of a hash
AspireBudget::Worksheets::Transactions.insert(date: '25/06/2020', outflow: 10.0, inflow: 12.0, category: 'test', account: 'AIB', memo: 'ruby', status: :pending)
=> #<AspireBudget::Models::Transaction:0x0000564acc1522b0 ... >

List category transfers

AspireBudget::Worksheets::CategoryTransfers.all
=> [#<AspireBudget::Models::CategoryTransfer:0x0000559501fddab8
#    @amount=46.37,
#    @date=#<Date: 2020-06-29 ((2459030j,0s,0n),+0s,2299161j)>,
#    @from="Available to budget",
#    @to="Lunch / Breakfast out",
#    @memo="Monthly target">,
#   <AspireBudget::Models::CategoryTransfer:0x0000559501fdd810
#    @amount=15.0,
#    @date=#<Date: 2020-06-29 ((2459030j,0s,0n),+0s,2299161j)>,
#    @from="Public Transport",
#    @memo="",
#    @to="Available to budget">]

Insert category transfer

AspireBudget::Worksheets::CategoryTransfers.insert(amount: 10, date: '25/06/2020', from: 'Available to budget', to: 'Electric Bill', memo: 'test')
=> #<AspireBudget::Models::CategoryTransfer:0x0000264acc1529b0 ... >

Development

todo

Contributing

Bug reports, feature requests and pull requests are welcome.

License

The gem is available as open source under the terms of the MIT License.