https://www.kaggle.com/datasets/adilshamim8/global-traffic-accidents-dataset
Using venv
(recommended for Python 3):(replace .venv with your preferred name)
python3 -m venv .venv
source .venv/bin/activate
pip install -r requirements.txt
pip install python-dotenv
KAGGLE_DATASET_SLUG=your_actual_dataset_slug
Follow the instructions to install MySQL Server on your machine:
-
Open MySQL command line or MySQL Workbench.
-
Create a new database:
CREATE DATABASE your_database_name;
Create a .env
file in the root directory of your project and add the following environment variables:
MYSQL_HOST=
MYSQL_USER=
MYSQL_PASSWORD=
MYSQL_DATABASE=
-
Go to your Kaggle account settings: https://www.kaggle.com/account
-
Scroll down to the "API" section and click "Create New API Token". This will download a file named
kaggle.json
. -
Move the
kaggle.json
file to the.kaggle
directory in your user home directory:-
On Windows:
mkdir %USERPROFILE%\.kaggle move C:\Path\To\Your\kaggle.json %USERPROFILE%\.kaggle\kaggle.json
-
On macOS/Linux:
mkdir -p ~/.kaggle mv /path/to/your/kaggle.json ~/.kaggle/kaggle.json
-
tailwindcss -i decoding_the_roads/styles/main.css -o decoding_the_roads/static/css/main.css --watch
Ensure your virtual environment is activated.
fastapi dev main.py
uvicorn decoding_the_roads.main:app --reload
http://127.0.0.1:8000/openapi.json