on-route-bot
Telegram bot will warn you about traffic jams on your route by schedule.
Installation and run
-
Clone repo.
-
Create python virtual environment and activete it:
python -m venv env source ./env/bin/activate
On Windows machines virtual env activates by command
env\Scripts\activate
-
Install required python modules:
pip install -r requirements.txt
-
Set required environment variables or fill in .env file.
-
Run bot:
python bot.py
Configure
Environment variables
- BOT_TOKEN - (str) Auth token to connect Bot to Telegram services.
- DB_FILE - (str) Sqlite database filename with relative path. Default: store/data.sqlite.
- DEBUG - (bool) Display debugging information in terminal session. Default: False.
- LOG_CONFIG - (dict) Configuring the logging module from a dictionary for
dictConfig()
function. Default: seeDEFAULT_CONFIG
in utils/log.py.
Minimal requirements
Any OS with version of Python >= 3.8. Hardware specs: 1 core CPU, 512 Mb of RAM.
- beautifulsoup4
- python-dotenv
- apscheduler
- sqlalchemy
- aiogram
- pydantic
- requests
Docker
docker-compose up -d
Use additional parameter --build
after changes the source or pull updates from repo.
Development and contribution
-
Formatting: default is autopep8, but black allowed with
-S
param (don't format single quotes). -
Linting: before commit check your code by pylint. Config at .pylintrc file.