Skip to content

mli42/smashgg-exporter

Repository files navigation

SmashGG Exporter

Start the project

Create and populate .env file

cp .env.example .env

Install dependencies

Install Python

Python 3.10 or newer is required.

Install Poetry

Please follow the steps on their website: https://python-poetry.org/docs/#installation

Install project dependencies with Poetry

poetry install

Run the project

There is two ways to run the project:

Via Poetry CLI
poetry run python src/main.py
Via virtual env

Activate virtual env (only once per terminal):

source .venv/bin/activate

Then use python directly:

python src/main.py

Usage

main.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`)

Misc

start.gg addrState in France
  • Auvergne-Rhône-Alpes
  • Bourgogne-Franche-Comté
  • Bretagne
  • Centre-Val de Loire
  • Grand Est
  • Hauts-de-France
  • Île-de-France, IDF
  • Normandie
  • Nouvelle-Aquitaine
  • Occitanie
  • Pays de la Loire
  • Provence-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 --all
Alembic
# Get information
alembic current/history

# Create a new migration
alembic revision --autogenerate -m "message"

# Apply migration
alembic upgrade head

# Downgrade migration
alembic downgrade -1

About

Fetches sets from start.gg and saves them into a postgreSQL database

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published