This is the webservice for the DeckIst. It's built using FastAPI.
To run webservice locally, follow these steps:
-
Clone this repository:
git clone https://github.com/fehimaltinisik/deckist.git
-
Navigate to the project directory:
cd deckist/webservice
-
Python 3.10 is required to run this project. You can download the latest version of Python from the official website. Then install dependencies using following commands.
pip install -r requirements.txt pip install -r requirements-dev.txt
Project uses small SQLite database to store GTFS data. You can create the database by following setups below.
scripts/downloadgtfs.py
: Run this script is used to download GTFS (General Transit Feed Specification) data from various URLs. It saves the downloaded data under src.resources.gtfs
python scripts/downloadgtfs.py
scripts/preprocessgtfs.py
: Run this script is used to preprocess the downloaded GTFS data. It reads the data from CSV files, fixes any issues, and saves the cleaned data back to CSV files.
python scripts/preprocessgtfs.py
scripts/savegtfstodb.py
: Run this script is used to save the preprocessed GTFS data to a SQLite database. It reads the data from the cleaned CSV files and saves it to the database using the Tortoise ORM. Running this script will create a local SQLite database.
python scripts/savegtfstodb.py
Once you have installed the dependencies and created the database, you can run the project using the following command.
python main.py
Project will be running on http://localhost:8000
.
DeckIst is licensed under the MIT License, allowing for flexibility in use and distribution.
It's important to note that while the code for this repository is licensed under the MIT License, the GTFS dataset used in the project is subject to its own licensing terms. Users should refer to the specifics licensing information provided by The Istanbul Metropolitan Municipality for the dataset.