-
Clone the repository:
git clone <repository-url>
-
Install the required dependencies:
pip install -r requirements.txt
-
Install the development dependencies if needed:
pip install -r requirements-dev.txt
-
Navigate to project folder
cd parcel_lab_project
-
Database Migration & fixures
python manage.py migrate python manage.py seed_shipments track_and_trace/fixtures/seed.csv
-
Set
OPEN_WEATHER_API_KEY
andOPENCAGE_API_KEY
api keys inlocal_settings.py
using the providedlocal_settings.template
-
Run the Development Server
python manage.py runserver
The server will start running on http://127.0.0.1:8000/.
-
Clone the repository:
git clone <repository-url>
-
Set
OPEN_WEATHER_API_KEY
andOPENCAGE_API_KEY
api keys inlocal_settings.py
using the providedlocal_settings.template
-
Build it:
docker build -t parcellab-challenge .
-
Run it:
docker run -p 8000:8000 parcellab-challenge
curl http://127.0.0.1:8000/api/track-shipment/?tracking_number=TN12345682&carrier=gls&weather_units=metric | json_pp
Notes:
- The endpoint is rate limited to
1000 requests / h
perip
which can be configured in settings. - Allowed values for weather_units parameter (optional):
metric
,imperial
,standard
To perform code quality checks, run the following commands:
pytest: Run tests.
pytest
ruff: An extremely fast Python linter, written in Rust.
ruff check .
isort: A Python utility / library to sort imports alphabetically, and automatically separated into sections and by type
isort .
mypy: Type checks
mypy .
For other languages change the LANGUAGE_CODE
in settings.py
.
Note: The translations have not been added to the *.po files yet.