- Karan Jhaveri
This project was done twice using 2 different programming languages:
- Python
- PHP
This application examines data stored in xml, yml or csv format files to produce a sum of the 'value' attribute.
Example Parameters for Script:
(Python)
- python script.py --input data/file.yml
- python script.py --input data/file.xml --output results/results.txt
(PHP) - php script.php --input data/file.csv
- php script.php --input=data/file.yml --output=results/results.txt
2 inputs are taken:
--input is Mandatory and --output is Optional
If no output argument supplied, the output prints to stdout .
Functional Test:
(Python)
- python test.py
(PHP) - php test.php
Results:
- 'recorded results' folder shows all the results from each run
- The sub-folders are segmented by input file-type
Steps Performed (Log):-
(Python)
- Install Python v.3
- Open Command-line
- Run Commands:
a. Navigate to the script's directory: 'cd /d D:..\Github\recruitment-task\Python'
b. Install the necessary packages for this project using pip
- csv
- xmltodict
- argparse
- yaml
- Completed script.py
- Functional tests conducted using test.py
(PHP) - Install Xampp
- Add PHP binary to Path (https://www.youtube.com/watch?v=neBVQBL_2P0)
- Installed Composer: https://getcomposer.org/download/
- Install Symfony:
a. Navigate to script's directory via Command-line
b. 'composer require symfony/symfony' (or alternatively 'compser require symfony/yaml') - Completed script.php
- Functional tests conducted using test.php
Development Strategy:
- Create code stub and roughly flesh out the idea
- Break each functionality of the application into smaller modules.
- Test each module independently and after including in the script
- Once script was complete, made a test script that validates the output of the main script