Enhancing Amarillo carpools as standalone (Docker) service.
This service complements the Amarillo service, taking Amarillo carpool files and filling in route information with additional stops and stop time data.
Example contents:
[
{"url": "https://datahub.bbnavi.de/export/rideshare_points.geojson", "vicinity": 50},
{"url": "https://data.mfdz.de/mfdz/stops/stops_zhv.csv", "vicinity": 50},
{"url": "https://data.mfdz.de/mfdz/stops/parkings_osm.csv", "vicinity": 500}
]
You can configure the stop sources file location with the environment variable stop_sources_file
.
amarillo-enhancer
uses uvicorn
to run. Uvicorn can be configured as normal by passing in arguments such as --port 8001
to change the port number.
amarillo-enhancer
uses a Graphhopper service for routing. You can configure the service that is used with the environment variable graphhopper_base_url
. By default it is https://api.mfdz.de/gh'
To enhance a trip, make a POST request to /
with the carpool data as the body. The enhancer will respond with the same carpool object enhanced with additional stop time and path data. The enhancer does not save the generated file.
When Amarillo receives a new carpool object, after returning an OK response it will make a request to the enhancer configured through the environment variable enhancer_url
. By default it points to 'http://localhost:8001'
.
- Python 3.10 with pip
- python3-venv
Create a virtual environment python3 -m venv venv
.
Activate the environment and install the dependencies pip install -r requirements.txt
.
Run uvicorn amarillo-enhancer.enhancer:app
.
In development, you can use --reload
.
You can download a container image from the MFDZ package registry.
Example command:
docker run -it --rm --name amarillo-gtfs-generator -p 8002:80 -e TZ=Europe/Berlin -v $(pwd)/data:/app/data amarillo-gtfs-generator```