This project provides a Python script to automate the parsing and structuring of data related to deported children. It reads lists of names and dates of birth from an Excel file, handles numerous complex formats and variations, and outputs a clean, structured dataset.
The application is containerized using Docker for easy setup and execution in any environment, and includes an automated test suite to ensure reliability.
() and separated by slashes /.2010 ะฐะฑะพ 21.06.2006), and incomplete dates (.07.2017).Status column (Successful, To Verify) to automatically flag records that may require manual review.Source Row Number and Source Data columns to the output, linking each parsed record to its original data.Dockerfile for easy setup, testing, and execution.pytest suite with unit and functional tests.. # The root of the deported_children_parser package
โโโ input/ # Directory for input data
โ โโโ Book.xlsx # The source Excel file should be placed here
โโโ output/ # Directory where parsed results will be saved
โโโ log/ # Directory where log files will be saved
โโโ tests/ # Contains all automated tests for the project
โ โโโ unit/ # Unit tests for individual functions
โ โโโ functional/ # Functional tests for component interactions
โโโ parser.py # The main application script
โโโ Dockerfile # Instructions for building the Docker image
โโโ requirements.txt # List of Python dependencies
To run the automated tests for this parser:
cd packages/deported_children_parser
pip install -r requirements.txt
pytest
These instructions are for running the pre-built Docker image from Docker Hub. No source code or Python installation is required.
Prerequisites: Dockerโ must be installed.
On your computer, create a main folder for your work (e.g., C:\parser_run). Inside it, create three subfolders: input, output, and log.
Place your Excel file (it must be named Book.xlsx) into the input folder you just created.
Open your terminal and navigate to the main workspace folder you created (e.g., cd C:\parser_run).
Execute the command below. Docker will automatically download the image and run the script.
Note: You may first need to create a public repository named deported-children-parser on your Docker Hub account (ivasteel).
docker run --rm \
-v "$(pwd)/input:/app/input" \
-v "$(pwd)/output:/app/output" \
-v "$(pwd)/log:/app/log" \
ivasteel/deported-children-parser
(For Windows Command Prompt, use %cd% instead of $(pwd))
The parsed file Parsed_Output.xlsx will appear in your output folder.
These instructions are for developers who have cloned the repository. All commands should be run from the root directory of the IOC repository.
git clone [https://github.com/ivasteel/IOC.git](https://github.com/ivasteel/IOC.git)
cd IOC
This command builds the image for this specific parser and tags it.
docker build -t deported-children-parser -f packages/deported_children_parser/Dockerfile .
This command runs the locally built image, mapping the correct project folders.
docker run --rm \
-v "$(pwd)/packages/deported_children_parser/input:/app/input" \
-v "$(pwd)/packages/deported_children_parser/output:/app/output" \
-v "$(pwd)/packages/deported_children_parser/log:/app/log" \
deported-children-parser
Vasyl Ivchyk
This project is MIT Licensed.
Content type
Image
Digest
sha256:3673eb9bcโฆ
Size
88.3 MB
Last updated
about 1 year ago
docker pull ivasteel/deported-children-parser