Skip to content

A Python application for analyzing customer orders, calculating monthly, product-wise, and customer-wise revenues, and identifying the top 10 customers by revenue.

License

Notifications You must be signed in to change notification settings

CLASPOG/SalesAnalyticsTool-Dockerized

Repository files navigation

Sales Analytics Tool - Dockerized File

This repository contains a Python application for analyzing customer orders from an online store. The application performs the following tasks:

  • Computes the total revenue generated by the online store for each month in the dataset.
  • Computes the total revenue generated by each product in the dataset.
  • Computes the total revenue generated by each customer in the dataset.
  • Identifies the top 10 customers by revenue generated.

Note

I am a windows user explaination are detailed for windows.

Warning

Turn on docker before starting the task.

Either use docker desktop directly OR

Open cmd as Administrator

net stop com.docker.service
net start com.docker.service

Table of Contents

  1. Project Structure
  2. Prerequisites
  3. Cloning the Repository
  4. Running the Application
  5. Running Tests
  6. Troubleshooting

Project Structure

  • orders_analysis.py: Main application script for processing the orders.
  • test_orders_analysis.py: Test script for the application.
  • Dockerfile: Dockerfile for the main application.
  • Dockerfile.test: Dockerfile for the test service.
  • docker-compose.yml: Docker Compose file to build and run the services.
  • orders.csv: Sample dataset of customer orders.
  • README.md: This readme file.

Prerequisites

With Docker

Without Docker

Cloning the Repository

To clone the repository, use the following command:

git clone https://github.com/anasjawed283/orders_analysis.git
cd orders_analysis

Running the Application

image

image

With Docker

  1. Build the Docker image:

    docker-compose build app
  2. Run the application:

    docker-compose up app

Without Docker

  1. Install dependencies:

    pipenv install
  2. Run the application:

    pipenv run python orders_analysis.py

Running Tests

image

image

With Docker

  1. Build the test Docker image:

    docker-compose build test
  2. Run the tests:

    docker-compose up test

Without Docker

  1. Install dependencies:

    pipenv install --dev
  2. Run the tests:

    pipenv run pytest test_orders_analysis.py

Troubleshooting

Common Issues

  1. Docker Daemon Not Running:

    • Ensure Docker Desktop is running on your machine. You can start it from the Start menu on Windows or via the terminal on macOS/Linux.
  2. Permission Issues:

    • If you encounter permission issues, try running the commands with sudo (for Linux/macOS) or as an Administrator (for Windows).
  3. Version Compatibility:

    • Ensure you are using compatible versions of Python and Docker. This application is tested with Python 3.12 and the latest Docker versions.
  4. WSL 2 Backend for Docker:

    • If you are using Docker with WSL 2, ensure that WSL 2 is properly installed and configured. Refer to the WSL 2 installation guide for more information.
  5. Docker Compose Version:

    • If you encounter a warning about the Docker Compose version being obsolete, update your docker-compose.yml to a more recent version or update Docker Compose itself.

Docker Specific Issues

  • Docker Daemon Not Starting:

    • Ensure Docker Desktop is running. If not, start Docker Desktop from the Start menu.
  • Containers Not Stopping:

    • Use the following command to stop and remove containers:

      docker-compose down

Conclusion

This repository provides a comprehensive solution for analyzing customer orders. You can run the application and tests using Docker for a consistent environment, or directly on your local machine with Python and Pipenv. Follow the instructions in this README to set up and use the application effectively.

For any issues or contributions, feel free to open an issue or pull request on the GitHub repository.


About

A Python application for analyzing customer orders, calculating monthly, product-wise, and customer-wise revenues, and identifying the top 10 customers by revenue.

Topics

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published