pip install -r requirements.txt
python main.py --mode generate
python main.py --mode parse
# For help:
python main.py -h
- --mode in (generate, parse)
- --path /path/to/directory
# Default data
- --xml-count int
# Default 100
- --zip-count int
# Default 50
In mode=='parse' -count args are ignored.
Assignment:
Implement python-app which should do following:
- Creates 50 zip-archives with 100 generated xml file in each with structure:
<root>
<var name='id' value='<unique random string value>'/>
<var name='level' value='<random integer in range from 1 to 100'/>
<objects>
<object name='<random string value>'/>
<object name='<random string value>'/>
…
</objects>
</root>
In objects
tag random count object
tag in range from 1 to 10.
-
Process a directory with generated zip files, parse nested xml-files and creates two csv-files:
First: id, level - for each xml-file.
Second: id, object_name - for each 'object' tag in each xml-file (1-10 row per xml).
For second part mandatory use multicore processors resources.