bankstatementparser-writer-qif
Writes bankstatementparser transactions as Quicken Interchange Format (QIF) files for GnuCash, Moneydance, Quicken, YNAB and other accounting tools.
Contents
Getting started
- Install: PyPI, source
- Requirements: toolchain floor, platforms
- Quick Start: convert a parsed statement to QIF
The bankstatementparser-writer-qif ecosystem
- The bankstatementparser-writer-qif ecosystem: the core library, the loaders, writers and servers
Library reference
- Capabilities at a glance: the current surface by theme
- Ecosystem comparison: short matrix; full table at
docs/COMPARISON.md - Benchmarks: headline numbers; full table at
docs/BENCHMARKS.md - Features: the public API and field mapping
- Configuration: the writer's arguments
- Examples: runnable example index
Operational
- When not to use bankstatementparser-writer-qif: limitations
- Development: make targets, fuzzing, CI
- Security: guarantees and compliance
- Documentation: all reference docs
- Stability guarantees: SemVer axis, output stability, minimum toolchain discipline
- License
Install
As a Python library
pip install bankstatementparser-writer-qif
That installs the writer, bankstatementparser >= 0.0.36 and pandas.
| Channel | Command | Notes |
|---|---|---|
| PyPI | pip install bankstatementparser-writer-qif |
Pulls in bankstatementparser >= 0.0.36 |
| Source | git clone https://github.com/sebastienrousseau/bankstatementparser-writer-qif && cd bankstatementparser-writer-qif && poetry install |
For local development |
Verify the installation:
python -c "import bankstatementparser_writer_qif as w; print(w.__version__)"
# -> 0.0.37
An isolated virtual environment keeps its dependencies apart:
python -m venv venv
source venv/bin/activate # macOS/Linux
venv\Scripts\activate # Windows
python -m pip install -U bankstatementparser-writer-qif
Requirements
- Python 3.10 or later. CI tests CPython 3.10, 3.11, 3.12, 3.13 and 3.14 on Linux, macOS and Windows;
docs/POLICIES.mdsays when the floor moves. bankstatementparser0.0.36 or later, for theTransactionmodel and the parsers that feed the writer, and pandas, which it brings.
Quick Start
from bankstatementparser import create_parser
from bankstatementparser_writer_qif import write_qif
# 1. Parse any statement the core supports (e.g. CAMT.053, MT940, CSV)
parser = create_parser("statement.xml")
# 2. Write it as a QIF file
write_qif(parser, "statement_export.qif", account_type="Bank")
write_qif accepts the parser itself (it calls parse()), the DataFrame parse() returns, a list of Transaction objects or a list of dicts, and returns the Path it wrote. to_qif takes the same arguments without the destination and returns the text.
The bankstatementparser-writer-qif ecosystem
bankstatementparser is a modular suite whose packages ship one version together. This package is its QIF writer; the full table, with every loader, writer and server, is in The suite.
| Component | Purpose | Use case |
|---|---|---|
bankstatementparser |
The parser core: CAMT, pain.001, CSV, OFX, QFX, MT940 and PDF statements | Parsing statements from Python or the CLI |
bankstatementparser-writer-qif |
Transactions to QIF | Importing statements into accounting tools |
| Other writers | XLSX, OFX and SWIFT MT940/MT942 | Other export formats |
| Loaders | BAI2, MT942, CFONB, CAMT.054, SEPA and BACS | Formats beyond the core |
bankstatementparser-transport-ebics, bankstatementparser-mcp, bankstatementparser-lsp |
EBICS data, Model Context Protocol and Language Server Protocol | Bank downloads, AI agents and editors |
Capabilities at a glance
| Area | Capability | Status |
|---|---|---|
| Input | list[Transaction], pandas.DataFrame, list[dict], or a core parser object |
Shipped |
| Header | !Type:Bank by default; any account type as given (CCard, Cash, ...) |
Shipped |
| Fields | D (date), T (amount), P (payee), M (memo), N (reference or check number), L (category), ^ (end) |
Shipped |
| Dates | ISO YYYY-MM-DD by default, or any strftime format such as %m/%d/%Y |
Shipped |
| Line safety | Every line break in a value becomes a space | Shipped |
| Investments, splits, accounts | !Type:Invst fields, split lines, !Account blocks |
Not implemented |
Ecosystem comparison
The choice is between this one-call writer for parsed statements and a full QIF library. Every cell comes from this repository or the other project's PyPI description.
| Project | Writes QIF | Reads QIF | Writes from |
|---|---|---|---|
| bankstatementparser-writer-qif | Yes | No | bankstatementparser transactions |
quiffen |
Yes | Yes | Its own QIF object model |
See docs/COMPARISON.md for the evidence and complete matrix.
Benchmarks
benches/bench_to_qif.py times one to_qif call for each input shape as the statement grows. Cost is linear: about 3 us per transaction from dicts or Transaction objects and 17 us from a DataFrame.
| Scenario | Result | Environment |
|---|---|---|
1,000 Transaction objects |
3.1 ms | Apple M1 Pro, macOS 27.2.1, CPython 3.12.16 |
10,000 Transaction objects (521 KiB of QIF) |
33 ms | Apple M1 Pro, macOS 27.2.1, CPython 3.12.16 |
| 10,000-row DataFrame | 166 ms | Apple M1 Pro, macOS 27.2.1, CPython 3.12.16 |
See docs/BENCHMARKS.md for methodology and full results.
Features
to_qif(data, account_type="Bank", date_format="%Y-%m-%d") -> str: serialises transactions to QIF text.write_qif(data, destination, account_type="Bank", date_format="%Y-%m-%d") -> Path: writes that text todestinationas UTF-8, creating missing parent directories.
Each record becomes a D line from the date, T from the amount (two decimals), P from the payee or description, M from the memo, N from the reference or check number and L from the category, then ^; an empty field is left out. The Usage page has the full mapping and fallbacks.
Configuration
There is no configuration file or environment variable; the writer's arguments are the configuration:
| Argument | Default | Meaning |
|---|---|---|
account_type |
"Bank" |
The header, !Type:<account_type> |
date_format |
"%Y-%m-%d" |
The strftime format for D lines; "%m/%d/%Y" for Quicken |
Examples
examples/ holds two runnable scripts, each run in CI:
| Example | Demonstrates |
|---|---|
01_basic_usage.py |
Two Transaction objects written with to_qif, with ISO and with US dates |
02_advanced_workflow.py |
A CSV statement (examples/data/statement.csv) converted to a QIF file with write_qif |
When not to use bankstatementparser-writer-qif
- You need investment accounts, splits or several accounts in one file. Records are bank-style (
D,T,P,M,N,L); there are no!Type:Invstfields, split lines or!Accountblocks. - You need currencies. QIF has no currency field; amounts are numbers only.
- You need bad input reported. An amount that does not parse, or is too large to write with cents, is written as given, and empty fields are left out, without an error.
- You need to read QIF. This package only writes it.
Development
git clone https://github.com/sebastienrousseau/bankstatementparser-writer-qif.git
cd bankstatementparser-writer-qif
poetry install
make check
make check runs the local gates: ruff lint and format, mypy --strict, Bandit, the complexity baseline (scripts/check_complexity.py), pytest with a 100% line and branch coverage floor, interrogate at 100% docstring coverage, the examples and the README template check. Other targets: make bench, make fuzz (Atheris, 60 s, Linux x86_64 with Python 3.12+), make docs (the MkDocs manual, --strict), make audit (pip-audit on the locked sets) and make demo (re-renders the GIF above with VHS from .github/demo.tape). CI adds the OS by Python matrix, the fuzz job, CodeQL and the Docs Lint gates. CONTRIBUTING.md covers the workflow and commit rules.
Security
- No network and no reads. The writer opens no connection and reads no file;
write_qifwrites only to the path you give. - One field per line. Every line break in a value becomes a space, so record text cannot start a field or a record of its own. QIF has no escape syntax, so nothing else is changed.
- Fuzzing.
fuzz/fuzz_to_qif.pydrivesto_qifwith Atheris in CI and fails on any exception, a lost or forged record, or a line without a field code. It found the line breaks fixed in 0.0.36. - Supply chain. Dependencies are locked in
poetry.lock, CI installs hash-pinned exports of it, andpip-audit, Bandit and CodeQL run on every change. Releases publish to PyPI through OIDC trusted publishing and carry cosign signatures, SLSA provenance and SBOMs; every workflow action is pinned by commit SHA except the SLSA generator, which must be referenced by tag.
Report vulnerabilities according to SECURITY.md.
Documentation
- User manual: sebastienrousseau.com/bankstatementparser-writer-qif, built from
docs/with MkDocs - API reference: the manual's API page, generated from the docstrings
- Developer docs:
CONTRIBUTING.md,ARCHITECTURE.md,GOVERNANCE.md,SUPPORT.md - The suite:
docs/suite.md, with everybankstatementparserpackage - History:
CHANGELOG.md
Stability guarantees
- Versioning. Releases stay on the
0.0.xline and step by exactly0.0.1, in lockstep with the rest of thebankstatementparsersuite. Under SemVer a0.0.xrelease may break anything; this project names each break in the CHANGELOG instead. - The breaking axis is the output: the QIF the writer produces for a given input. A change to a line, its value or its fallback is called out in the CHANGELOG as breaking, even when no Python signature moves.
- Python API.
to_qifandwrite_qifkeep their names and arguments; names starting with_are internal. - Minimum toolchain. Python 3.10 is the floor; it moves only in a release, for the whole suite at once, with the reason in the CHANGELOG (
docs/POLICIES.md).
License
Dual-licensed under Apache License, Version 2.0 or MIT, at your option (SPDX-License-Identifier: Apache-2.0 OR MIT). Any contribution submitted for inclusion in the work shall be dual-licensed as above, without additional terms or conditions.
Metadata
Release files for bankstatementparser-writer-qif 0.0.37
For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.
Source distribution (sdist)
| File | Size | Uploaded | Provenance | Actions |
|---|---|---|---|---|
| bankstatementparser_writer_qif-0.0.37.tar.gz | 13.6 kB | With provenance | Details for bankstatementparser_writer_qif-0.0.37.tar.gz |
Built distribution (wheel)
| File | Interpreter | ABI | Platform | Actions Reset |
|---|---|---|---|---|
| bankstatementparser_writer_qif-0.0.37-py3-none-any.whl | Python 3 | none | any | Details for bankstatementparser_writer_qif-0.0.37-py3-none-any.whl |
Total release size: 28.4 kB
Release files / bankstatementparser_writer_qif-0.0.37.tar.gz
| Download URL | bankstatementparser_writer_qif-0.0.37.tar.gz |
|---|---|
| Size | 13.6 kB |
| Tags | Source |
|
SHA-256 checksum How to use checksums |
7391442fa88287226e672d1590bda393daf0b29670b889ac62e1b6fa729652f1
|
|
BLAKE2b-256 checksum How to use checksums |
88e592fc60bfef9e8f40d1464a5b909314af1c35f0f089dde4e9b3c32cea8dc9
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
Yes |
| Uploaded via |
twine/7.0.0 CPython/3.13.16
|
Provenance
Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.
PyPI Publish Attestation
PyPI verified that this artifact, at this checksum, originated from the publisher listed below.
Signed by GitHub Actions, verified by PyPI on Nov 29, 2026.
Transparency logRelease files / bankstatementparser_writer_qif-0.0.37-py3-none-any.whl
| Download URL | bankstatementparser_writer_qif-0.0.37-py3-none-any.whl |
|---|---|
| Size | 14.9 kB |
| Tags | Python 3 |
|
SHA-256 checksum How to use checksums |
e5065134ad8206feb9f61932a31b99a0412dc19f22d6c9bead9916151a650618
|
|
BLAKE2b-256 checksum How to use checksums |
b703b558313c851ab33198c8b80da3195d295168b5b88d4d35d4b2e46296808c
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
Yes |
| Uploaded via |
twine/7.0.0 CPython/3.13.16
|
Provenance
Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.
PyPI Publish Attestation
PyPI verified that this artifact, at this checksum, originated from the publisher listed below.
Signed by GitHub Actions, verified by PyPI on Nov 29, 2026.
Transparency logSecurity for bankstatementparser-writer-qif 0.0.37
Provenance
Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.
Full provenance
Both files in this release have been uploaded with provenance metadata.
Attestation for bankstatementparser_writer_qif-0.0.37.tar.gz
PyPI Publish Attestation
PyPI verified that this artifact, at this checksum, originated from the publisher listed below.
Signed by GitHub Actions, verified by PyPI on Nov 29, 2026.
Transparency logA note on package security
PyPI is a repository for distributing packages, not a service for auditing them. While third-party security researchers and our staff do their best to detect and remove malicious packages, PyPI cannot guarantee the quality, security or suitability of any given package.
To learn more about protecting yourself from malicious actors, visit our package security documentation.