Giter Club home page Giter Club logo

bil-pdf-statement-parser's Introduction

BIL PDF statement parser

This application is capable of processing multiple PDF statements, downloaded from the bil.com online banking application to create a single CSV or HTML page from the extracted transactions.

1. Installation

Note: I have only tested with the following versions, sorry. :)

$ cat /etc/os-release | grep PRETTY
PRETTY_NAME="Ubuntu 14.04.4 LTS"

$ php -v
PHP 5.6.19-1+deb.sury.org~trusty+1 (cli)
Copyright (c) 1997-2016 The PHP Group
Zend Engine v2.6.0, Copyright (c) 1998-2016 Zend Technologies
    with Zend OPcache v7.0.6-dev, Copyright (c) 1999-2016, by Zend Technologies
    with Xdebug v2.3.3, Copyright (c) 2002-2015, by Derick Rethans

$ dpkg -l | grep poppler-utils
ii  poppler-utils  0.24.5-2ubuntu4.3  amd64  PDF utilities (based on Poppler)

1.1. Requirements

I didn't find a PHP native solution that was able to provide a deterministic extraction of these PDF files, so I ended up with the poppler-utils provided pdftohtml application, as it is able to extract the text into xml, which allows the parsing with a small state machine logic, line-by-line.

sudo apt-get install pdftohtml

1.2. Setup

composer require tommey/bil-pdf-statement-parser

2. Usage

2.1. Examples

You can find two examples for the usage:

  1. Batch script, which prints out CSV format: php batch/bil-pdf-statement-csv.php <your directory with pdf files>
  2. Web page, which show the transactions in HTML format: php -S localhost:8080 -t /path/to/this/repo/web then open http://localhost:8080/bil-pdf-statement-html.php HTML example screenhost

2.2. Custom usage

The public interface is provided by the BilPdfStatementParser class via static factory methods.

You can easily create your own formatter, by implementing the TransactionListFormatterInterface.

See for example classes under src/Formatter for:

  • CSV
  • HTML
  • JSON
  • Highcharts

3. Contribution

Feel free to file bugs or fix them right away and send a pull request. :-)

4. License

MIT License

Copyright (c) 2016 Tamás Tóth

bil-pdf-statement-parser's People

Contributors

tamastoth-mecharex avatar tommey avatar

Watchers

 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.