A simple python script to calculate in how many sub-divisions cubers compted in (made with polish voivodeships in mind).
The results of this script get uploaded to my nekoweb site daily.
For all countries that ever held a WCA competition, it gets its subdivisions and their names from this shapefile.
- Clone the repo and cd into it
- Create a
dbsecrets.pyfile with theSECRET_HOST,SECRET_USER,SECRET_DATABASE,SECRET_PASSWORDfields with the credentials needed to connect to your database. - Load the results export onto that database.
- Create a folder called
borders - Download the shapefiles from this list and put them in folders as such
- Create a python virtual environment
python3 -m venv .venv - Install the requirements
./venv/bin/pip install -e . - Run the main script
./venv/bin/python __main__.py
- Create a
nekoweb_secrets.pyfile with theAPI_KEYandBASE_PATHfields. API_KEYis the key you can get from here,BASE_PATHis the path you wish the results get uploaded to, in my case/shab.nekoweb.org/regions- Note: that folder must exist before running the script.
- Run the upload script
./venv/bin/python nekoweb_uploader.py
