A simple web scraping program to get data from HEMA Scorecard to text files for OBS to consume.
Project description
HEMA Scorecard Scraper
A simple web scraping program to get data from HEMA Scorecard to text files for OBS to consume. Created for IFG's Tournament of the Roses 2026. It is not affiliated with HEMA Scorecard in any way. Made without the use of any AI tools.
Legal Notice
By using this software you agree to only use the web scraper during events and test runs of events. There exist several safeguards to try and prevent you from spamming HEMA Scorecard with http requests, but if you modify the software, that may occur. For that reason, any modifications to this software must not poll the site more the 5 times per secound and must retain the original timeout of 8 hours or less.
Don't make me take this package offline.
This work is licensed under CC BY-SA 4.0
Installation
This guide is for unix based systems, commands for Windows installation may vary.
-
Ensure you have Python 3 installed.
-
Run
python3 -m pip -install hema_scorecard_scraperthough a terminal.
Usage
Once HEMA Scorecard Scraper has been installed, you can start the program from the terminal using the command python3 -m hema_scorecard_scraper.scraper_console.
While the scraper is running, you should have a console in the terminal that you can type commands into. Note that the scraper console is in the "stopped" position by default and you will need to run the start command to start fetching data. Files will be outputted into a directory named out located wherever you are running the program from.
Commands
<cookie>
Similar to the URL command, you can enter your PHPSESSID cookie that HEMA scorecard gives you. This will let the scraper see the same matches you see. This should only be nessisary if you're running a mock bout for an event and haven't published the matches yet. This mode is kinda janky since hema scorecard displays diffrent information to organizers/staff than to your random user. YMMV
help
Displays this list of commands.
next
Switches the scraper to track the next match by match number. Normally this will advance to the next match in the pool, but if you are at the end of a pool, it will advance to the next pool. Also writes the data to the files immidently.
prev
Same as the next command except it increments the match number down, not up.
start
Starts running the scraper in the background. Updates every half second. The scraper is initially in the stopped position so you will have to run this command once to get things going once you have it pointed at the right match. If the program is still running 8 hours after you've started this command, it will time out run the stop command. This is meant to prevent someone from leaving this program running in the background by accident.
stop
Stops the scraper running in the background.
quit
Exits the program entirely.
<url>
Sets the scraper to track a specific match. The indended use case is for you to copy the url of the match from the HEMA Scorecard site, and paste it into the console. (You do not need to type <url>, just enter the url itsself.)
Output Information
Left/Right/Match Prefixes
All fighter data files are prependded with either fighter_left or fighter_right depending on if they appear on the left or right side of the HEMA Scorecard display. Match data files are prepended with the match prefix.
Fighter Name
The name of the fighter as it appears on HEMA scorecard.
Fighter School
The name of the fighter's school as it appears on HEMA scorecard.
Fighter Score
The current score of the fighter.
Match Doubles
The number of doubles present in the match.
Why doesn't this scraper capture match time?
Because of how HEMA Scorecard is coded, match time is a little more difficult to grab. Also, for the Tournament of Roses ruleset it's not particularly important. (Matches very rarely come down to time) Because of this, the Roses streaming team didn't need match time. If it's imporant for your event, feel free to fork this repository and make a pull request when you have it working!
Project details
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
Built Distribution
Filter files by name, interpreter, ABI, and platform.
If you're not sure about the file name format, learn more about wheel file names.
Copy a direct link to the current filters
File details
Details for the file hema_scorecard_scraper-0.2.1.tar.gz.
File metadata
- Download URL: hema_scorecard_scraper-0.2.1.tar.gz
- Upload date:
- Size: 13.1 kB
- Tags: Source
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/6.2.0 CPython/3.13.13
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
e51758d089228a2e75ec1d86bfc4202603647f7f4dec230b8340b59dc26e0113
|
|
| MD5 |
cf77c5a6037331c31a8606d275acb7e1
|
|
| BLAKE2b-256 |
068b0c632217727d331b94c0bada19721b00ace4b8b327c070341d4848b25d1f
|
File details
Details for the file hema_scorecard_scraper-0.2.1-py3-none-any.whl.
File metadata
- Download URL: hema_scorecard_scraper-0.2.1-py3-none-any.whl
- Upload date:
- Size: 13.7 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/6.2.0 CPython/3.13.13
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
d0b5e11d70f5410bb234dd23832a7f5597e0b58659b7691fac93a22b1cab89a1
|
|
| MD5 |
589d6d33a8674cfce291e0296093b950
|
|
| BLAKE2b-256 |
28488a0cc5aa506fe2b9a6f43b22a3080e3010179e17b3f62ad597d4fec2c0a0
|