# ofxstatement-french
This project provides custom
[ofxstatement](https://github.com/kedder/ofxstatement) plugin(s) for these french
financial institutions:
- BanquePopulaire, France, PDF (https://www.banquepopulaire.fr/)
`ofxstatement` is a tool to convert a proprietary bank statement to OFX
format, suitable for importing into programs like GnuCash or Beancount. The
plugin for ofxstatement parses the bank statement and produces a common data
structure, that is then formatted into an OFX file.
The PDF is converted using the
[pdftotext](https://pypi.org/project/pdftotext/) utility.
## Financial institutions
### BanquePopulaire
This bank allows you to download OFX files but only for transactions not older
than 90 days. In order to read the transactions older than 90 days, you need to
download a PDF from their site: Mon espace -> Mes documents électroniques -> Comptes /
Epargne et placements. This utility can convert such a PDF to an OFX
file.
Having a PDF is also useful for a visual verification but it is only generated
every month, so you may need to download the OFX file now and then too for the
actual status. There rests one problem: the OFX file generated by
BanquePopulaire contains FITIDs not equal to the default FITID generated by
this utility. So my solution is to download the OFX from BanquePopulaire
regularly and the PDF every month. In the [Configuration](#configuration)
setup you can specify wildcards for the location of OFX files so that this
utility will use the FITID from the (downloaded) OFX instead of its own
default and hence any financial program will see the same transaction whether
it is from the downloaded OFX or from the OFX created from the PDF. The OFX
and PDF may also differ in some details like DATE, PAYEE and MEMO fields and
this will be handled too by processing downloaded OFX files for their FITID.
## Installation
### Preconditions
You have to install the poppler library first, see
[pdftotext](https://pypi.org/project/pdftotext/)
### Using pip
```
$ pip install ofxstatement-french
```
### Development version from source
```
$ git clone https://github.com/gpaulissen/ofxstatement-french.git
$ pip install -e .
```
### Troubleshooting
This package depends on ofxstatement with a version at least 0.6.5. This
version may not yet be available in PyPI so install that from source like
this:
```
$ git clone https://github.com/gpaulissen/ofxstatement.git
$ pip install -e .
```
## Test
To run the tests from the development version you can use the py.test command:
```
$ py.test
```
You may need to install the required test packages first:
```
$ pip install -r test_requirements.txt
```
## Usage
### Show installed plugins
This shows the all installed plugins, not only those from this package:
```
$ ofxstatement list-plugins
```
You should see at least:
```
The following plugins are available:
...
fr-banquepopulaire BanquePopulaire, France, PDF (https://www.banquepopulaire.fr/)
...
```
### Convert
Use something like this:
```
$ ofxstatement convert -t fr-banquepopulaire <file>.pdf <file>.ofx
```
Or you can convert the PDF yourself and supply the text as input:
```
$ pdftotext -layout <file>.pdf <file>.txt
$ ofxstatement convert -t fr-banquepopulaire <file>.txt <file>.ofx
```
See also the section configuration below.
### Configuration
For BanquePopulaire you may download their OFX files and use them to provide
you with their OFX FITID numbers instead of relying on FITID numbers generated
by the ofxstatement tool. You can specifiy the OFX files to read first using
the ofxstatement configuration. The OFX files configuration is a comma
separated list of wildcard specifications relative to the PDF to convert.
You may also need to set a bank id, since the statement files do not always
contain bank information like the BIC code in this line:
```
IBAN FR99 9999 9999 9999 9999 9999 999 BIC CCBPFRPPBDX *** C A S D E N-B P ***
```
```
$ ofxstatement edit-config
```
This is a sample configuration (do not forget to specify the plugin for each section):
```
[banquepopulaire]
plugin = fr-banquepopulaire
ofx_files = *.ofx, ../*.ofx
bank_id = CCBPFRPPBDX
```
Now this statement will convert <file>.pdf downloaded from BanquePopulaire
(Mon Espace -> Mes documents électroniques -> Comptes) to <file>.ofx while
using the FITIDs found in the *.ofx files in the directory of <file>.pdf or in
its parent directory.
```
$ ofxstatement convert -t banquepopulaire <file>.pdf <file>.ofx
```
## Change history
See the Changelog (CHANGELOG.md).
# Changelog
All notable changes to this project will be documented in this file.
The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.0.0/),
and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0.html).
## [Unreleased]
## [1.5.0] - 2023-12-29
## Changed
- [Determination of OFX FITID for a PDF must use final OFX FITIDs from the cache.](https://github.com/gpaulissen/ofxstatement-french/issues/1)
## [1.4.1] - 2022-02-23
### Changed
- The plugin ofx_files which is a list of file specifications is checked for containing files
## [1.4.0] - 2021-01-18
### Added
- Ability to set the bank id in the configuration.
## [1.3.1] - 2020-05-23
### Changed
- In case a transaction is duplicated (in several files), the
latest transaction and thus FITID read will prevail. A transaction
key is composed of ACCTID, CHECKNUM, DTPOSTED, TRNAMT and NAME
(either CHECKNUM or NAME is empty).
## [1.3.0] - 2020-05-23
### Changed
- Replaced the ofxparse library by beautifulsoup4 since the former
does only read one bank account and a BanquePopulaire OFX file
may contain several bank accounts (conform the OFX standard).
- The ofx_files configuration may be a list of comma separated
file name specifications instead of just one file name
specification.
- The ofx_files cache will provide the OFX FITID for PDF statement
line ID if there is a match on any of the three dates (DATE
COMPTA, DATE OPERATION, DATE VALEUR) in the PDF. Usually DATE
COMPTA is equal to DTPOSTED from the OFX, but not always.
- The ofx_files cache will provide the PAYEE and MEMO fields if
there is a match since BanquePopulaire does not necessarily show
the same values for the same transaction in a PDF and OFX file.
## [1.2.0] - 2020-05-02
### Changed
- Added the ability to retrieve the OFX id (FITID) from OFX files
downloaded from BanquePopulaire instead of using an id generated
by the ofxstatement tool.
## [1.1.1] - 2020-03-23
### Changed
- The generation af a unique OFX id did only return a counter in
case of duplicates
- The Readme mentions now my fork of the ofxstatement instead of
https://github.com/kedder/ofxstatement.git
- The __about__.py file outputs the version number and that is
used in the Makefile
- The Makefile depends now on GNU make for tagging a release
## [1.1.0] - 2020-03-22
### Added
- This Changelog
- The Readme mentions test_requirements.txt for installing test modules
- More checks concerning the content (dates with start and end
date exclusive) that may result in a ValidationError exception
- Casden accounts also supported
- Negative balances recognized
- Added Makefile for keeping the important operations together
### Changed
- The date will now be the accounting date (DATE COMPTA) instead of operation date (DATE OPERATION).
- Handling of 29 february improved
- Improved handling of graphics in the PDF which transforms to a
description starting with F and whitespace.
- The BIC is also recognized if the line does not end with a BIC
followed by only whitespace (hence BIC<ws><number><ws><.+> is now
allowed)
- Better determination of the statement header.
## [1.0.0] 2020-03-16
### Added
- Converting the French BanquePopulaire PDFs to an OFX file.
Raw data
{
"_id": null,
"home_page": "https://github.com/gpaulissen/ofxstatement-french",
"name": "ofxstatement-french",
"maintainer": "",
"docs_url": null,
"requires_python": "",
"maintainer_email": "",
"keywords": "ofx,banking,statement,BanquePopulaire",
"author": "Gert-Jan Paulissen",
"author_email": "gert.jan.paulissen@gmail.com",
"download_url": "https://files.pythonhosted.org/packages/64/d1/f9823f05a918e1bb1a59136d902103d8f5b65fb65540480ec987cbb2e08b/ofxstatement-french-1.5.0.tar.gz",
"platform": null,
"description": "# ofxstatement-french\n\nThis project provides custom\n[ofxstatement](https://github.com/kedder/ofxstatement) plugin(s) for these french\nfinancial institutions:\n- BanquePopulaire, France, PDF (https://www.banquepopulaire.fr/)\n\n`ofxstatement` is a tool to convert a proprietary bank statement to OFX\nformat, suitable for importing into programs like GnuCash or Beancount. The\nplugin for ofxstatement parses the bank statement and produces a common data\nstructure, that is then formatted into an OFX file.\n\nThe PDF is converted using the\n[pdftotext](https://pypi.org/project/pdftotext/) utility.\n\n## Financial institutions\n\n### BanquePopulaire\n\nThis bank allows you to download OFX files but only for transactions not older\nthan 90 days. In order to read the transactions older than 90 days, you need to\ndownload a PDF from their site: Mon espace -> Mes documents \u00e9lectroniques -> Comptes /\nEpargne et placements. This utility can convert such a PDF to an OFX\nfile.\n\nHaving a PDF is also useful for a visual verification but it is only generated\nevery month, so you may need to download the OFX file now and then too for the\nactual status. There rests one problem: the OFX file generated by\nBanquePopulaire contains FITIDs not equal to the default FITID generated by\nthis utility. So my solution is to download the OFX from BanquePopulaire\nregularly and the PDF every month. In the [Configuration](#configuration)\nsetup you can specify wildcards for the location of OFX files so that this\nutility will use the FITID from the (downloaded) OFX instead of its own\ndefault and hence any financial program will see the same transaction whether\nit is from the downloaded OFX or from the OFX created from the PDF. The OFX\nand PDF may also differ in some details like DATE, PAYEE and MEMO fields and\nthis will be handled too by processing downloaded OFX files for their FITID.\n\n## Installation\n\n### Preconditions\n\nYou have to install the poppler library first, see\n[pdftotext](https://pypi.org/project/pdftotext/)\n\n### Using pip\n\n```\n$ pip install ofxstatement-french\n```\n\n### Development version from source\n\n```\n$ git clone https://github.com/gpaulissen/ofxstatement-french.git\n$ pip install -e .\n```\n\n### Troubleshooting\n\nThis package depends on ofxstatement with a version at least 0.6.5. This\nversion may not yet be available in PyPI so install that from source like\nthis:\n```\n$ git clone https://github.com/gpaulissen/ofxstatement.git\n$ pip install -e .\n```\n\n## Test\n\nTo run the tests from the development version you can use the py.test command:\n\n```\n$ py.test\n```\n\nYou may need to install the required test packages first:\n\n```\n$ pip install -r test_requirements.txt\n```\n\n## Usage\n\n### Show installed plugins\n\nThis shows the all installed plugins, not only those from this package:\n\n```\n$ ofxstatement list-plugins\n```\n\nYou should see at least:\n\n```\nThe following plugins are available:\n\n ...\n fr-banquepopulaire BanquePopulaire, France, PDF (https://www.banquepopulaire.fr/)\n ...\n\n```\n\n### Convert\n\nUse something like this:\n\n```\n$ ofxstatement convert -t fr-banquepopulaire <file>.pdf <file>.ofx\n```\n\nOr you can convert the PDF yourself and supply the text as input:\n\n```\n$ pdftotext -layout <file>.pdf <file>.txt\n$ ofxstatement convert -t fr-banquepopulaire <file>.txt <file>.ofx\n```\n\nSee also the section configuration below.\n\n### Configuration\n\nFor BanquePopulaire you may download their OFX files and use them to provide\nyou with their OFX FITID numbers instead of relying on FITID numbers generated\nby the ofxstatement tool. You can specifiy the OFX files to read first using\nthe ofxstatement configuration. The OFX files configuration is a comma\nseparated list of wildcard specifications relative to the PDF to convert.\n\nYou may also need to set a bank id, since the statement files do not always\ncontain bank information like the BIC code in this line:\n\n```\nIBAN FR99 9999 9999 9999 9999 9999 999 BIC CCBPFRPPBDX *** C A S D E N-B P ***\n```\n\n\n\n```\n$ ofxstatement edit-config\n```\n\nThis is a sample configuration (do not forget to specify the plugin for each section):\n\n```\n[banquepopulaire]\nplugin = fr-banquepopulaire\nofx_files = *.ofx, ../*.ofx\nbank_id = CCBPFRPPBDX\n```\n\nNow this statement will convert <file>.pdf downloaded from BanquePopulaire\n(Mon Espace -> Mes documents \u00e9lectroniques -> Comptes) to <file>.ofx while\nusing the FITIDs found in the *.ofx files in the directory of <file>.pdf or in\nits parent directory.\n\n```\n$ ofxstatement convert -t banquepopulaire <file>.pdf <file>.ofx\n```\n\n## Change history\n\nSee the Changelog (CHANGELOG.md).\n# Changelog\n\nAll notable changes to this project will be documented in this file.\n\nThe format is based on [Keep a Changelog](https://keepachangelog.com/en/1.0.0/),\nand this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0.html).\n\n## [Unreleased]\n\n## [1.5.0] - 2023-12-29\n\n## Changed\n\n- [Determination of OFX FITID for a PDF must use final OFX FITIDs from the cache.](https://github.com/gpaulissen/ofxstatement-french/issues/1)\n\n## [1.4.1] - 2022-02-23\n\n### Changed\n\n- The plugin ofx_files which is a list of file specifications is checked for containing files\n\n## [1.4.0] - 2021-01-18\n\n### Added\n\n- Ability to set the bank id in the configuration.\n\n## [1.3.1] - 2020-05-23\n\n### Changed\n\n- In case a transaction is duplicated (in several files), the\n latest transaction and thus FITID read will prevail. A transaction\n key is composed of ACCTID, CHECKNUM, DTPOSTED, TRNAMT and NAME\n (either CHECKNUM or NAME is empty).\n\n## [1.3.0] - 2020-05-23\n\n### Changed\n\n- Replaced the ofxparse library by beautifulsoup4 since the former\n does only read one bank account and a BanquePopulaire OFX file\n may contain several bank accounts (conform the OFX standard).\n- The ofx_files configuration may be a list of comma separated\n file name specifications instead of just one file name\n specification.\n- The ofx_files cache will provide the OFX FITID for PDF statement\n line ID if there is a match on any of the three dates (DATE\n COMPTA, DATE OPERATION, DATE VALEUR) in the PDF. Usually DATE\n COMPTA is equal to DTPOSTED from the OFX, but not always.\n- The ofx_files cache will provide the PAYEE and MEMO fields if\n there is a match since BanquePopulaire does not necessarily show\n the same values for the same transaction in a PDF and OFX file.\n\n## [1.2.0] - 2020-05-02\n\n### Changed\n\n- Added the ability to retrieve the OFX id (FITID) from OFX files\n downloaded from BanquePopulaire instead of using an id generated\n by the ofxstatement tool.\n\n## [1.1.1] - 2020-03-23\n\n### Changed\n\n- The generation af a unique OFX id did only return a counter in\n case of duplicates\n- The Readme mentions now my fork of the ofxstatement instead of\n https://github.com/kedder/ofxstatement.git\n- The __about__.py file outputs the version number and that is\n used in the Makefile\n- The Makefile depends now on GNU make for tagging a release\n\n## [1.1.0] - 2020-03-22\n\n### Added\n\n- This Changelog\n- The Readme mentions test_requirements.txt for installing test modules\n- More checks concerning the content (dates with start and end\n date exclusive) that may result in a ValidationError exception\n- Casden accounts also supported\n- Negative balances recognized\n- Added Makefile for keeping the important operations together\n\n### Changed\n\n- The date will now be the accounting date (DATE COMPTA) instead of operation date (DATE OPERATION).\n- Handling of 29 february improved\n- Improved handling of graphics in the PDF which transforms to a\n description starting with F and whitespace.\n- The BIC is also recognized if the line does not end with a BIC\n followed by only whitespace (hence BIC<ws><number><ws><.+> is now\n allowed)\n- Better determination of the statement header.\n\n## [1.0.0] 2020-03-16\n\n### Added\n\n- Converting the French BanquePopulaire PDFs to an OFX file.\n",
"bugtrack_url": null,
"license": "GPLv3",
"summary": "OFXStatement plugin for french financial institutions like BanquePopulaire.",
"version": "1.5.0",
"project_urls": {
"Homepage": "https://github.com/gpaulissen/ofxstatement-french"
},
"split_keywords": [
"ofx",
"banking",
"statement",
"banquepopulaire"
],
"urls": [
{
"comment_text": "",
"digests": {
"blake2b_256": "807e4a923432ad66bb4d68b4d6c045053c4feddc3f4b22e2c3abdb7c6d448c55",
"md5": "8a7fc96af4861e9afbc9bbec8ce90d30",
"sha256": "fa8c835886c190b886808ae85b5cd96269a55fa4871443001c0b8791c9c77e28"
},
"downloads": -1,
"filename": "ofxstatement_french-1.5.0-py3-none-any.whl",
"has_sig": false,
"md5_digest": "8a7fc96af4861e9afbc9bbec8ce90d30",
"packagetype": "bdist_wheel",
"python_version": "py3",
"requires_python": null,
"size": 17581,
"upload_time": "2023-12-29T10:52:15",
"upload_time_iso_8601": "2023-12-29T10:52:15.747478Z",
"url": "https://files.pythonhosted.org/packages/80/7e/4a923432ad66bb4d68b4d6c045053c4feddc3f4b22e2c3abdb7c6d448c55/ofxstatement_french-1.5.0-py3-none-any.whl",
"yanked": false,
"yanked_reason": null
},
{
"comment_text": "",
"digests": {
"blake2b_256": "64d1f9823f05a918e1bb1a59136d902103d8f5b65fb65540480ec987cbb2e08b",
"md5": "588985b4d1684afed203ee544ef086ba",
"sha256": "84fe6b67c1d010e95d330eacf7fd914da4e321b199c1bf6c1be0eb8ccd93bc7f"
},
"downloads": -1,
"filename": "ofxstatement-french-1.5.0.tar.gz",
"has_sig": false,
"md5_digest": "588985b4d1684afed203ee544ef086ba",
"packagetype": "sdist",
"python_version": "source",
"requires_python": null,
"size": 23409,
"upload_time": "2023-12-29T10:52:17",
"upload_time_iso_8601": "2023-12-29T10:52:17.590420Z",
"url": "https://files.pythonhosted.org/packages/64/d1/f9823f05a918e1bb1a59136d902103d8f5b65fb65540480ec987cbb2e08b/ofxstatement-french-1.5.0.tar.gz",
"yanked": false,
"yanked_reason": null
}
],
"upload_time": "2023-12-29 10:52:17",
"github": true,
"gitlab": false,
"bitbucket": false,
"codeberg": false,
"github_user": "gpaulissen",
"github_project": "ofxstatement-french",
"travis_ci": false,
"coveralls": false,
"github_actions": false,
"requirements": [],
"test_requirements": [],
"lcname": "ofxstatement-french"
}