This application converts a pipe-delimited row based file into an XML file.
-
Python 3.x installed on your system.
-
The
lxmllibrary installed. If you haven't installed it yet, you can do so using pip:pip install lxml
-
Prepare your Row Based File
-
Create a file named
input(one is provided) in the same directory as your code. -
Format your file with a pipe (
|) as the delimiter. For example:P|förnamn|efternamn T|mobilnummer|fastnätsnummer A|gata|stad|postnummer F|namn|födelseår
-
-
Run the Application
python main.py
-
Output
- After running, a file named
output.xmlwill be generated in the same directory. - The generated XML file will contain the XML representation of your row based data.
- After running, a file named
-
Run the Tests
-
Use the
unittestmodule to run the tests:python -m unittest discover tests
-
-
Test Assertions
- The tests will check the basic functionality of the
RowBasedToXMLConverter, ensuring that it correctly processes and converts the input data to XML.
- The tests will check the basic functionality of the
-
Shortcomings
- More extensive tests
- Constants and tags in
data_formatinutils/converter.pycould be loaded dynamically via a yaml-file to increase the flexibility and scalability. - Logging features
- Dockerize the application and put it behind an API-endpoint for deployment as a microservice or similiar in the cloud