parse_capitalone_pdf_statement

Gem Version Build Status Dependency Status

The Capital One website only provides a way to download structured data of credit card transaction history for the previous 180 days. However, you are able to download monthly PDF account statements for the previous few years.

This library allows you to parse a Capital One PDF monthly statement, and access structured transaction history data.

Installation

Add this line to your application's Gemfile:

gem 'parse_capitalone_pdf_statement'

And then execute:

% bundle

Or install it yourself as:

% gem install parse_capitalone_pdf_statement

Convert PDF to JSON

Use the capitalone_pdf_to_json.rb script to convert a PDF montly statement to JSON.

% capitalone_pdf_to_json.rb my_monthly_statement.pdf > my_monthly_statement.json

API Example

Parse a PDF monthly statement and print all payments:

require 'parse_capitalone_pdf_statement'

statement = CapitalOneStatement.new('/path/to/my_monthly_statement.pdf')

statement.payments.each do |payment|
  puts 'Transaction ID: %d'   % payment.id
  puts 'Card Number:    %d'   % payment.card_number
  puts 'Date:           %s'   % payment.date
  puts 'Description:    %s'   % payment.description
  puts 'Amount:         %.2f' % payment.amount
end

See the API Documentation for more information.

License

Copyright (c) 2014 Joe Sortelli

MIT License