The XRechnung XML Generator is a tool designed to generate XML files that comply with the XRechnung standard from CSV exports. XRechnung is an XML-based semantic data model used for electronic invoices, particularly in transactions with public clients in Germany. Starting January 1, 2025, all companies will be required to issue and receive e-invoices in accordance with EN 16931.
- Generate XRechnung-compliant XML files from CSV inputs.
- Supports multiple UBL template versions.
- Simple command-line interface for generating executable files.
To install and set up the project locally, follow these steps:
-
Clone the repository:
git clone https://github.com/xSentry/xrechnungs-generator.git cd xrechnungs-generator
-
Install the required Python packages:
pip install -r requirements.txt
-
To create an executable file, run:
pyinstaller main.spec
-
The new executable file (
xRechnung-v*.exe
) will be located in thedist/
folder. Replace*
with the version number.
To generate XML files using the tool:
- Place your CSV file in the appropriate directory.
- Run the executable or the
main.py
script. - Follow the prompts to select the CSV file and desired output location.
To add a new UBL template, follow these steps:
- Create a template in the
/templates/
folder with the formatubl-VERSION_NUMBER-xrechnung-template.xml
. - Add the version number to the array on line 81 of
main.py
:self.selectUblVersion.addItems(['3.0.1', 'VERSION_NUMBER'])
- Update
main.spec
to include the new template file in thedatas
field:datas=[('templates/ubl-3.0.1-xrechnung-template.xml', 'templates'), ('templates/ubl-VERSION_NUMBER-xrechnung-template.xml', 'templates')],
- Generate a new executable as described in the Installation section.
We welcome contributions! To contribute:
- Fork the repository.
- Create a new branch for your feature or bug fix:
git checkout -b feature-name
- Commit your changes:
git commit -m "Add feature-name"
- Push to the branch:
git push origin feature-name
- Create a Pull Request.
This project is licensed under the MIT License. See the LICENSE file for details.
For questions or support, please open an issue on the GitHub repository or contact the maintainer directly through GitHub.