Automatically generate ranking lists for Swissleague XC-Cup events by scraping flight data from XContest.
The XC Cup Ranker project aims to extract flight data from XContest and calculate rankings for Swissleague XC-Cup events based on pilot performances. This tool provides a convenient way to track top performers and event standings using automated data processing.
- Web Scraping: Utilizes web scraping techniques to retrieve flight data from XContest.
- Ranking Calculation: Calculates rankings based on specified criteria (e.g. flight distance, event-specific performance metrics).
- Data Visualization: Presents rankings in a clear and informative format.
Follow these instructions to set up and run the XC-Cup Ranker locally.
- Python 3.10 or higher
uvfor dependency management (recommended)- Alternatively,
virtualenvorcondafor manual setup
-
Clone the repository:
git clone https://github.com/ruben-hutter/xc-cup-ranker.git cd xc-cup-ranker -
Create a virtual environment using
uv:uv venv .venv source .venv/bin/activate # Linux/macOS .venv\Scripts\activate # Windows (CMD/PowerShell)
-
Install dependencies:
uv sync
-
Create and activate a virtual environment:
python -m venv .venv source .venv/bin/activate # Linux/macOS .venv\Scripts\activate # Windows (CMD/PowerShell)
-
Install dependencies:
pip install -r requirements.txt
-
Create and activate a new Conda environment:
conda create -n xc-cup-env python=3.10 conda activate xc-cup-env
-
Install dependencies:
pip install -r requirements.txt
Run the script using one of the provided scripts for your platform:
- Linux/macOS:
./run.sh <event_id> [-y|--year <year>] [-v|--verbose] [--pdf]
- Windows (CMD):
run.bat <event_id> [-y|--year <year>] [-v|--verbose] [--pdf]
- Windows (PowerShell):
run.ps1 <event_id> [-y|--year <year>] [-v|--verbose] [--pdf]
Replace <event_id> with the event you want to rank. The optional -y or --year parameter defaults to the current year. Use -v or --verbose for additional output details and --pdf to generate a PDF report.
Contributions are welcome! Follow these steps to contribute to the project:
- Fork the repository.
- Create a new branch (
git checkout -b feature-branch). - Make your changes and commit them (
git commit -am 'Add new feature'). - Push the branch (
git push origin feature-branch). - Create a new pull request.
This project is licensed under the MIT License - see the LICENSE file for details.