This project is a mix of three parts: a webhook that satifies the requirements of the Deliveroo Orders API, a simple Order Management System that interacts directly with the Orders DB, and Jupyter Notebooks for data analysis to measure the impact of Dynamic Pricing.
All the Deliveroo related decisions in this codebase are based on requirements from Deliveroo Orders API.
- Python 3.10
- Key Dependencies: See
requirements.txt
You can install the Dynamic Pricing API by cloning the repository and installing the required dependencies.
git clone https://github.com/Sree5835/dynamic_pricing
cd dynamic_pricing
Using a virtual environment allows for a clean and isolated environment for you to install project dependencies and run code. To create a virtual environment within the project, run (depending on whether your Python command is python
or python3
):
python -m venv .venv
You can activate your virtual environment with:
source .venv/bin/activate
With Windows, use:
.venv\Scripts\activate
You can then install all dependencies and build within the virtual environment when activated. To deactivate, run:
deactivate
This project not only has exter dependencies in requirements.txt
, it also has a dynamic_pricing package that is set up using the setup.py
. Therefore, to install all depdencies and build, run:
pip install -r requirements.txt
pip install .
This repository uses the pre-commit library to enable pre-commit hooks with the project. These hooks allow for various checks to be completed when you run git commit, ensuring that no un-linted and un-formatted code is persisted to the remote repositories. We have two main hooks set up:
Black (formatter)
Pylint (linting)
You only need to set up pre-commit once when you clone this repo, by running:
pre-commit install
This repository contains an .env.example
file with example environment variables for usage in the code. The code will attempt to read from .env
file at the top level of the repository. To ensure this file is present, run:
cp .env.example .env
This project uses pytest
as the unit testing framework. To run the unit tests, you can run:
pytest
We use pytest-cov as our coverage plugin. To run pytest and generate a HTML coverage report, you can run:
pytest --cov=src --cov-report=html