This project provides a Python script to automate the parsing and structuring of error reports from exchanges with the Ministry of Health of Ukraine (MOHU).
The application is containerized using Docker for easy setup and execution in any environment, and includes an automated test suite to ensure reliability.
ΠΠΎΠΌΠΈΠ»ΠΊΠΈ column and uses ΠΠΎΠΌΠ΅Π½ΡΠ°ΡΡ as a fallback.Source Row column to the output, linking each parsed record to its original line in the input file.parsing_log.txt file for each run while also displaying progress in the console.pytest suite with unit and functional tests to ensure code reliability.Dockerfile for easy setup, testing, and execution.. # The root of the mohu_error_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
βββ README.md # The main project documentation
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: Replace your-dockerhub-username with your actual Docker Hub login.
docker run --rm \
-v "$(pwd)/input:/app/input" \
-v "$(pwd)/output:/app/output" \
-v "$(pwd)/log:/app/log" \
your-dockerhub-username/mohu-error-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 and want to build the image and run tests locally. All commands should be run from the root directory of the IOC repository.
git clone [https://github.com/your-username/IOC.git](https://github.com/your-username/IOC.git)
cd IOC
This command will build the image, run the automated tests inside the container, and tag the image as mohu-error-parser.
docker build -t mohu-error-parser -f packages/mohu_error_parser/Dockerfile .
This command runs the locally built image and maps the correct project folders.
docker run --rm \
-v "$(pwd)/packages/mohu_error_parser/input:/app/input" \
-v "$(pwd)/packages/mohu_error_parser/output:/app/output" \
-v "$(pwd)/packages/mohu_error_parser/log:/app/log" \
mohu-error-parser
If you want to run tests without Docker:
cd packages/mohu_error_parser
pip install -r requirements.txt
pytest
Your Name
This project is MIT Licensed β feel free to use and modify it! :)
Content type
Image
Digest
sha256:648b86fe0β¦
Size
88.3 MB
Last updated
about 1 year ago
docker pull ivasteel/mohu-error-parser