JPK FA parser - a simple Python script to parse JPK_FA XML file and convert loaded data to CSV, JSON or DB.
What is JPK (in Polish) https://poradnikprzedsiebiorcy.pl/-jpk-fa-struktura-wszystko-co-warto-wiedziec
JPK structure (in Polish) https://www.gov.pl/web/kas/struktury-jpk
.venv\Scripts\python -m pip install -r requirements.txt
DB_HOST=localhost
DB_NAME=jpk_fa_db
DB_USER=db_user
DB_PASSWORD=db_password
#DB_PORT=5432
There is an example input.xml
file with some basic (partial!) data.
Use your real exported JPK file XML file. You can do that using Subiekt123
(https://subiekt123.pl/) or other accounting software.
In Subiekt 123 go to Księgowość
-> +
icon on top right -> select Faktury VAT (JPK_FA)
and dates range -> Select version JPK_VAT (v3)
-> Zapisz
-> Export XML file
python -c "import sys, xml.dom.minidom as md; print(md.parse(sys.stdin).toprettyxml())" < input.xml > output.xml
.venv\Scripts\python -m unittest
.venv\Scripts\python -m pylint **/*.py
.venv\Scripts\python main.py input.xml csv
or
start.bat csv
.venv\Scripts\python main.py input.xml json
or
start.bat json
.venv\Scripts\python main.py input.xml html
or
start.bat html
.venv\Scripts\python main.py input.xml db
or
start.bat db
start.bat clear