{ "cells": [ { "cell_type": "markdown", "metadata": {}, "source": [ "# Example how to use bank record importer\n", "\n", "first initalize, also add some styles so things look nicer" ] }, { "cell_type": "code", "execution_count": 1, "metadata": { "ExecuteTime": { "end_time": "2019-06-08T18:59:39.733499Z", "start_time": "2019-06-08T18:59:39.716574Z" }, "init_cell": true }, "outputs": [ { "data": { "text/html": [ "" ], "text/plain": [ "" ] }, "metadata": {}, "output_type": "display_data" } ], "source": [ "%%html\n", "" ] }, { "cell_type": "code", "execution_count": 2, "metadata": { "ExecuteTime": { "end_time": "2019-06-08T18:59:40.477200Z", "start_time": "2019-06-08T18:59:40.456518Z" }, "init_cell": true }, "outputs": [], "source": [ "from IPython.core.display import display\n", "from statement_reader import csv2bookings, pdf2bookings, txt2bookings" ] }, { "cell_type": "markdown", "metadata": {}, "source": [ "# Load a pdf bank statement and display it" ] }, { "cell_type": "code", "execution_count": null, "metadata": { "ExecuteTime": { "end_time": "2019-06-08T18:33:40.941773Z", "start_time": "2019-06-08T18:33:40.777784Z" } }, "outputs": [], "source": [ "bookings1 = pdf2bookings('AZG114123440_003_20190329.pdf')\n", "display(bookings1)" ] }, { "cell_type": "markdown", "metadata": {}, "source": [ "# Manually edit the text data from a bank statement and load it\n", "sometime it is usefull to first convert the pdf to text, edit it and afterwards import it.\n", "\n", "To convert the pdf run\n", "\n", "`pdftotext -layout statement.pdf statement.txt`\n", "\n", "\n", "Afterwards you can use sed to remove not needed blocks\n", "\n", "`cat statement.txt | sed 's/^[ ]*\\\\([0-3][0-9][.][0-1][0-9].[ ]*\\\\) /\\\\1 /' | sed -ne '/[0-3][0-9][.][0-1][0-9].[ ]\\\\{{1,4\\\\}}/,/^[_ \\\\t-]*\\(SALDO NEU.*\\)\\{{0,1\\}}$/ p' | sed '/^[_ \\\\t-]*$/ d' > imports.txt`" ] }, { "cell_type": "code", "execution_count": null, "metadata": {}, "outputs": [], "source": [ "bookings2 = txt2bookings('imports.txt')" ] }, { "cell_type": "markdown", "metadata": { "ExecuteTime": { "end_time": "2019-06-08T18:57:15.905386Z", "start_time": "2019-06-08T18:57:15.897196Z" } }, "source": [ "# Load csv\n", "is also super easy" ] }, { "cell_type": "code", "execution_count": null, "metadata": {}, "outputs": [], "source": [ "bookings3 = csv2bookings('bookings.csv')" ] }, { "cell_type": "markdown", "metadata": {}, "source": [ "# Combine and display" ] }, { "cell_type": "code", "execution_count": null, "metadata": {}, "outputs": [], "source": [] } ], "metadata": { "celltoolbar": "Initialization Cell", "kernelspec": { "display_name": "Python 3", "language": "python", "name": "python3" }, "language_info": { "codemirror_mode": { "name": "ipython", "version": 3 }, "file_extension": ".py", "mimetype": "text/x-python", "name": "python", "nbconvert_exporter": "python", "pygments_lexer": "ipython3", "version": "3.7.3" }, "varInspector": { "cols": { "lenName": 16, "lenType": 16, "lenVar": 40 }, "kernels_config": { "python": { "delete_cmd_postfix": "", "delete_cmd_prefix": "del ", "library": "var_list.py", "varRefreshCmd": "print(var_dic_list())" }, "r": { "delete_cmd_postfix": ") ", "delete_cmd_prefix": "rm(", "library": "var_list.r", "varRefreshCmd": "cat(var_dic_list()) " } }, "types_to_exclude": [ "module", "function", "builtin_function_or_method", "instance", "_Feature" ], "window_display": false } }, "nbformat": 4, "nbformat_minor": 2 }