Ruby library for extracting data from GnuCash data files
Add this line to your application's Gemfile:
gem 'gnucash'
And then execute:
$ bundle
Or install it yourself as:
$ gem install gnucash
require "gnucash"
book = Gnucash.open("MyBook.gnucash")
book.accounts.each do |account|
puts "#{account.full_name}: #{account.final_balance}"
end
act = book.find_account_by_full_name("Assets::Checking")
balance = Gnucash::Value.zero
act.transactions.each do |txn|
balance += txn.value
$stdout.puts(sprintf("%s %8s %8s %s",
txn.date,
txn.value,
balance,
txn.description))
end
- Fork it
- 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 new Pull Request