Skip to content

robin-wendel/citwin-api

Repository files navigation

CITWIN API

Python Docker License Status

Developed as part of the CITWIN research project, this Python-based API implements a computational pipeline for the accessibility analysis of public transport stops. The framework combines origin–destination data with NetAScore bikeability and walkability indices to assess and quantify active mobility accessibility in urban environments.


Development

Run the API locally (.env.local)

python main.py

Run the API with Docker (.env.docker)

docker compose up --build
docker compose down --volumes

Deployment

Deploy: clone / pull repository to project directory, configure nginx, start the API in a Docker container (.env.deploy.*)

sh deploy.sh prod
sh deploy.sh staging
sh deploy.sh dev

Undeploy: stop and remove containers, delete project directory, unconfigure nginx

sh undeploy.sh prod
sh undeploy.sh staging
sh undeploy.sh dev

Testing

Test the pipeline

Local (.env.local)

python tests/test_run_pipeline_access.py
python tests/test_run_pipeline_access.py --upload-netascore

Test the API

Local (.env.local)

python tests/test_api_pipeline_access.py --base-url http://localhost:8000 --no-download
python tests/test_api_pipeline_access.py --base-url http://localhost:8000 --no-download --upload-netascore

Remote – Production (.env.local)

python tests/test_api_pipeline_access.py --base-url http://zgis228.geo.sbg.ac.at/api/citwin-prod --no-download
python tests/test_api_pipeline_access.py --base-url http://zgis228.geo.sbg.ac.at/api/citwin-prod --no-download --upload-netascore

Remote – Staging (.env.local)

python tests/test_api_pipeline_access.py --base-url http://zgis228.geo.sbg.ac.at/api/citwin-staging --no-download
python tests/test_api_pipeline_access.py --base-url http://zgis228.geo.sbg.ac.at/api/citwin-staging --no-download --upload-netascore

Remote – Development (.env.local)

python tests/test_api_pipeline_access.py --base-url http://zgis228.geo.sbg.ac.at/api/citwin-dev --no-download
python tests/test_api_pipeline_access.py --base-url http://zgis228.geo.sbg.ac.at/api/citwin-dev --no-download --upload-netascore

About

No description, website, or topics provided.

Resources

Stars

Watchers

Forks

Packages

No packages published