Bank Statement Parser: Installation Prerequisites

Welcome to the Bank Statement Parser User Guide. Get started with our Python library for easy CAMT and SEPA file parsing and streamline your financial analysis.

Bank Statement Parser:  Setup and Usage Guide

System Requirements

Before beginning, ensure your system meets the following criteria:

Installation

Create a Virtual Environment

We recommend creating a virtual environment to install the Bank Statement Parser. This will ensure that the package is installed in an isolated environment and will not affect other projects.

Bank Statement Parser: Installation Prerequisites

python3 -m venv venv
source venv/bin/activate  # On Windows use `venv\Scripts\activate`

Installing the Bank Statement Parser

Install bankstatementparser with just one command:

pip install bankstatementparser

Installing Dependencies

Open your CLI and navigate to the library’s directory, then execute the following:

pip install -r requirements.txt

divider

Get the Source Code on GitHub

You can access the source code for the Bank Statement Parser by downloading releases, browsing or even contributing to its development on GitHub ⧉. You can also report issues and request new features, which we will review and address as soon as possible.

divider

Usage

CAMT Files

Bank Statement Parser:  Usage

from bankstatementparser import CamtParser

# Initialize the parser with the CAMT file path
camt_parser = CamtParser('path/to/camt/file.xml')

# Parse the file and get the results
results = camt_parser.parse()

PAIN.001 Files

from bankstatementparser import Pain001Parser

# Initialize the parser with the PAIN.001 file path
pain_parser = Pain001Parser('path/to/pain/file.xml')

# Parse the file and get the results
results = pain_parser.parse()

divider

Command Line Interface (CLI) Guide

Leverage the CLI for quick parsing tasks with the following commands:

Basic Command

python cli.py --type <file_type> --input <input_file> [--output <output_file>]

Examples for CAMT Files

  1. Parse a CAMT file and print the results to the console:

    python cli.py --type camt --input path/to/camt/camt_file.xml
    

    Using the test data:

    python ./bankstatementparser/cli.py --type camt --input ./tests/test_data/camt.053.001.02.xml
    
  2. Parse a CAMT file and save the results to a CSV file:

    python cli.py --type camt --input path/to/camt/file.xml --output path/to/output/file.csv
    

    Using the test data:

    python ./bankstatementparser/cli.py --type camt --input ./tests/test_data/camt.053.001.02.xml --output ./tests/test_data/camt_file.csv
    

Examples for PAIN.001 Files

  1. Parse a PAIN.001.001.03 file and print the results to the console:
python cli.py --type pain001 --input path/to/pain.001.001.03.xml

Using the test data:

python ./bankstatementparser/cli.py --type pain001 --input ./tests/test_data/pain.001.001.03.xml
  1. Parse a PAIN.001.001.03 file and save the results to a CSV file:
python cli.py --type pain001 --input path/to/pain.001.001.03.xml --output path/to/output/file.csv

Using the test data:

python ./bankstatementparser/cli.py --type pain001 --input ./tests/test_data/pain.001.001.03.xml --output ./tests/test_data/pain_file.csv