Git Product home page Git Product logo

bank_parser's Introduction

travis Coverage Status

BankParser

Tool to load bank data and convert it to a monthly overview.

Work in progress. Currently a startup file will look like this:

By default the tool wil look for a base folder along the following structure:

import logging
from pathlib import Path

from bankparser.helpers import get_bank_data
from bankparser.post_processors.extract import Extract
from bankparser.post_processors.label import Label
from bankparser.readers.parse_ing import IngParser
from bankparser.readers.parse_rabo import RaboParser
from bankparser.readers.parser import save_file
from bankparser.reports.monthly_report import make_report

LOGGER = logging.getLogger(__name__)


def make_report_location(base_banking_folder: Path, year: str):
    return base_banking_folder.joinpath(
        "output/report_{}.txt".format(year)
    )


if __name__ == "__main__":
    bank_data = get_bank_data()

    base_banking_folder = Path(
        "~/base_bank_data_folder"
    )

    # CSV data containing ING bank csv data.
    csv_ing_folder = base_banking_folder.joinpath("csv\\ing")
    LOGGER.info("ING_FOLDER: %s", csv_ing_folder)

    ing_parser = IngParser(bank_data, csv_ing_folder, skip_lines=1)
    ing_parser.process_folder()

    # CSV data containing Rabo bank transaction data.
    csv_rabo_folder = base_banking_folder.joinpath("csv\\rabo")
    LOGGER.info("RABO Folder: %s", csv_rabo_folder)
    
    rabo_parser = RaboParser(bank_data, csv_rabo_folder, skip_lines=1)
    rabo_parser.process_folder()

    # The location to store one big dict containing all above banking data.
    out_location = base_banking_folder.joinpath("output/out.json")
    LOGGER.info("OUTPUT_FILE: %s", out_location)

    save_file(out_location, bank_data)

    # A post processor modifying the data dict.
    labeller = Label(bank_data, base_banking_folder)
    labeller.setup()
    labeller.process()

    extractor = Extract(bank_data,base_banking_folder)
    extractor.setup()
    extractor.process()

    # Output file contain the year.
    make_report(bank_data, "2018",
                make_report_location(base_banking_folder, "2018"))

bank_parser's People

Contributors

sander76 avatar

Watchers

 avatar  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.