As part of a customer project, we developed a Python-based solution that automatically converts bank files in camt.053 format to the older MT940 format. Our customer imports account movements into their ERP system, which currently only supports MT940 files. Since the bank will soon be switching to the more modern camt.053 format, our team has already developed a Python-based solution that automatically converts bank files in camt.053 format to the older MT940 format. This allows the existing ERP system to continue to be used while seamlessly supporting the bank’s future format change.
Initial Situation
The MT940 format has been the standard for electronic account statements for decades. It is compact, line-based and, particularly in German-speaking countries, expanded by specific structures in the :86: fields, which contain additional information, such as the purpose of use, mandate references or creditor IDs. The newer camt.053 format is based on XML and was designed as its successor as part of the introduction of SEPA. It offers significantly more structure and depth of detail, but is not yet (fully) supported by older systems.
The aim of the project was therefore to achieve reliable, automated translation of camt.053 files to MT940 in order to continue existing processes seamlessly.
Technical Implementation
The Python library mt940_writer was used for implementation, supplemented by xml.etree.ElementTree for processing the XML data. After reading the camt files, the booking information is extracted, converted into MT940-compatible fields, and then exported as a complete MT940 file.
Particular focus was placed on the correct mapping of amounts, booking data, and :86: field contents, which have standardized substructures in German payment transactions. Extensive validations ensure that the generated files can be processed error-free in all target systems.
Challenges with Foreign Business Transactions
The conversion of foreign transactions posed a particular challenge. While German entries in the :86: field contain clearly defined structures, this information is often unstructured or stored in free text in international payments. Here, the solution had to respond flexibly and implement appropriate fallback mechanisms in order to correctly transfer the relevant information to the MT940 format. This ensured that international payments were also processed reliably and integrated cleanly into existing processes.
Conclusion
The result is a stable, maintainable Python tool that automatically converts camt.053 files to MT940. This allows the customer to continue using their existing system landscape despite the bank’s format change without costly adjustments.
The project shows how targeted software development can secure existing processes while efficiently managing technological transitions. With practical implementation and proven strategies, we are happy to support you in meeting the challenges of handling accounting data – get in touch with us!
Photo: https://ccnull.de/foto/kontoauszug/1006525

