This project has been initially done to provide a backend infrastructure for Scripta Manent
We will leave this project as it is for now an focus on having a more global approach to serve the data from each instance.
All API endpoints are automatically documented in /docs
The easiest option if you have Docker installed as it will automatically download the latest data available for you.
docker build --build-arg=COMMIT=$(git rev-parse --short HEAD) --tag ota-legacy-api:latest .
docker run -d --name myapi -p 80:80 ota-legacy-api:latest
The API is served at localhost
.
docker run --platform ota-legacy-api --platform linux/amd64 -d --name myapi -p 80:80 ota-legacy-api:latest
This API was built using python3.8
. We suggest you use a virtual environment.
virtualenv venv
source venv/bin/activate
You will also need a local copy of the dataset. By default, it is assumed to be in ./dataset
but you can always change this by editing ./app/config.py
.
To download the dataset, run :
./download_dataset.sh
Install requirements
python -m pip install -r requirements.txt
And run the app :
export PYTHONPATH=".":"./app/"
uvicorn main:app --reload
The required setup in order to contribute to the repo:
pip install -r requirements-dev.txt
python -m python_githooks
The API has a /check_for_dataset
route that automatically finds out if a newer version of the dataset has been released here and update the API to use it.
You can check which dataset release is being used by calling the /version
endpoint.
The code in this repository is distributed under the European Union Public Licence (EUPL) v1.2.