Skip to content

Latest commit

 

History

History

webservice

DeckIst Webservice

This is the webservice for the DeckIst. It's built using FastAPI.

Prerequisites

To run webservice locally, follow these steps:

  1. Clone this repository:

    git clone https://github.com/fehimaltinisik/deckist.git
  2. Navigate to the project directory:

    cd deckist/webservice
  3. 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

Init Db

Project uses small SQLite database to store GTFS data. You can create the database by following setups below.

  1. 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
  1. 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
  1. 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

Running the Project

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.

License

DeckIst is licensed under the MIT License, allowing for flexibility in use and distribution.

Data License

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.