cp .env.example .envPython 3.10 or newer is required.
Please follow the steps on their website: https://python-poetry.org/docs/#installation
poetry installThere is two ways to run the project:
Via Poetry CLI
poetry run python src/main.pyVia virtual env
Activate virtual env (only once per terminal):
source .venv/bin/activateThen use python directly:
python src/main.pymain.py
$ python src/main.py --help
usage: main.py [-h] [--startDate STARTDATE] [--endDate ENDDATE] [--countryCode COUNTRYCODE] [--addrState ADDRSTATE]
Fetches sets from start.gg and saves them into a postgres database
options:
-h, --help show this help message and exit
--startDate STARTDATE
fetch from startDate DD-MM-YYYY (default: 01-01-2025)
--endDate ENDDATE fetch up to endDate DD-MM-YYYY (default: 01-04-2025)
--countryCode COUNTRYCODE
CountryCode of the tournament, can be set to `None` (default: FR)
--addrState ADDRSTATE
AddrState of the tournament, can be set to `None` (default: IDF)
export_db_to_csv.py
$ python src/export_db_to_csv.py --help
usage: export_db_to_csv.py [-h] [--startDate STARTDATE] [--endDate ENDDATE] [--countryCode COUNTRYCODE] [--addrState ADDRSTATE] [--outSuffix OUTSUFFIX]
Fetches sets from database and saves them in a local csv
options:
-h, --help show this help message and exit
--startDate STARTDATE
fetch from startDate DD-MM-YYYY (default: 01-01-2025)
--endDate ENDDATE fetch up to endDate DD-MM-YYYY (default: 01-04-2025)
--countryCode COUNTRYCODE
CountryCode of the tournament, can be set to `None` (default: FR)
--addrState ADDRSTATE
AddrState of the tournament, can be set to `None` (default: IDF)
--outSuffix OUTSUFFIX
csv output filename to `output/{timestamp}-{outSuffix}.csv` (default: `output/{timestamp}.csv`)
start.gg addrState in France
Auvergne-Rhône-AlpesBourgogne-Franche-ComtéBretagneCentre-Val de LoireGrand EstHauts-de-FranceÎle-de-France,IDFNormandieNouvelle-AquitaineOccitaniePays de la LoireProvence-Alpes-Côte d'Azur
IDF and Île-de-France behave like two different addrState and have to be fetched separately
Poetry
# Clear Poetry cache
poetry cache clear --all .
# Delete all virtual environments
poetry env remove --allAlembic
# Get information
alembic current/history
# Create a new migration
alembic revision --autogenerate -m "message"
# Apply migration
alembic upgrade head
# Downgrade migration
alembic downgrade -1