XML Value Retrieval Web Application

Introduction

This web application is created using the Flask framework, designed to fetch a specific value from an XML file (sma_gentext.xml) using a provided target ID. To ensure that existing files are not overwritten, the retrieved value is saved to a text file (out_put_value.txt) with a unique name.

Prerequisites

Python 3.8.0

Flask library installed. install it using: "pip install Flask"

How to use the application

1. Clone the repository to your local machine using the command:

2. Navigate to the cloned repository directory.

3. Run the Flask application by executing the following command in the terminal:

python app.py

4. Access the application in your web browser at http://localhost:5000/

5. Enter a valid target ID (e.g., 42007) in the input field and click "Submit."

6. The application will retrieve the value from the XML file (sma_gentext.xml) for the specified target ID and save it to a unique output file (out_put_value.txt).

7. The Results successfully saved in a project folder it will be displayed on the webpage.

8. If the target ID is not found in the XML file or an error occurs, an error message will be shown.

9. If successful, you can download the output file containing the retrieved value using the "Download Result"

10. You can repeat the process by entering different target IDs and clicking "Submit" again.

simple way to Use the application using Docker

To run the Docker image you need to follow these steps:

Step 1: Open your web browser and go to the Docker website: https://www.docker.com/ Create account and install the docker

Step 2: After installing Docker on your system login to Docker

Step 3: Open terminal and Pull the Docker Image: Use the "docker pull" command to download the Docker image from the Docker Hub repository:

docker pull obireddy572/work_test_app:latest

Step 4: Run the Docker Container: After pulling the image, you can use the "docker run" command to start the container:

docker run -d -p 5000:5000 obireddy572/work_test_app:latest

Explanation of the command: -d: Detach the container and run it in the background. -p 5000:5000: Map port 5000 of the host to port 5000 inside the container. obireddy572/work_test_app:latest: This specifies the name and version (tag) of the Docker image to run. With this command, you can access the application in your web browser by navigating to http://localhost:5000

Resutls of screenshots with web Application

Results of the web application you check the 'Screenshots' folder for better understanding.

https://github.com/obi-reddy/Etteplan-Work-Test/commit/cbab4e71a9288d8c0c21a6edc6d2de3ed61465ea