Skip to content

Addovej/xml_parse_test_demo

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

5 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Test demo

xml-zip generator

Usage

pip install -r requirements.txt
python main.py --mode generate
python main.py --mode parse

# For help:
python main.py -h

Available options:

  • --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:

  1. 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.

  1. 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.

About

No description, website, or topics provided.

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages