Collection of scripts to analyze the results of the Empire State Run Up race
Project description
Empire State Run Up
Hello. I wrote an application to analyse the results of the 'Empire State Run Up', 2013 edition, after I ran the race.
Here you will find my code.
If you just want to install it
See the previous section called 'Packaging', and then install it on your virtual environment:
python3 -m venv ~/virtualenv/EmpireStateRunUp
. ~/virtualenv/EmpireStateRunUp/bin/activate
pip install --upgrade pip
python -m build .
pip install --upgrade dist/EmpireStateRunUp-0.0.1-py3-none-any.whl
There are 4 scripts that you can run:
- esru_numbers
- esru_outlier
- esru_browser
- esru_plot
If you have uvx, you can run any of them like this:
uvx --from EmpireStateRunUp esru_numbers
uvx --from EmpireStateRunUp esru_outlier
uvx --from EmpireStateRunUp esru_browser
uvx --from EmpireStateRunUp esru_plot
If you want to learn more about these programs, please grab a cup of coffe and read the TUTORIAL
If you are a developer
Running the code in developer mode
python3 -m venv ~/virtualenv/EmpireStateRunUp
. ~/virtualenv/EmpireStateRunUp/bin/activate
pip install --upgrade pip
pip install --editable .[dev,lint]
Modifying the layout without restarting the apps
For example, playing with the 'esru_outlier' application:
. ~/virtualenv/EmpireStateRunUp/bin/activate
pip install textual-dev
# On another terminal: . ~/virtualenv/EmpireStateRunUp/bin/activate && textual console
textual run --dev empirestaterunup.apps:run_outlier
Packaging
python3 -m venv ~/virtualenv/EmpireStateRunUp
. ~/virtualenv/EmpireStateRunUp/bin/activate
pip install --upgrade pip
pip install --upgrade build
pip install --upgrade wheel
python -m build .
Installation from PiPy
For your user:
pip install --user EmpireStateRunUp
Or using a virtual environment:
python -m venv ~/virtualenv/EmpireStateRunUp && \
. ~/virtualenv/EmpireStateRunUp/bin/acvtivate && \
pip install EmpireStateRunUp
Country codes
I used the files generated by the ISO-3166-Countries-with-Regional-Codes for the flag lookup, using Regional indicator symbol.
Notes: Data from the 2025 race is full of errors. Whoever entered the data decided than things like not populating the country of origin was correct:
{"name": "Alessandro Manrique", "bib": "377", "age": 20, "country": "US", "locality": "Mexico", "gender": "M", "state": "Wisconsin", "racer_has_finished": true, "split_data": [{"name": "Full Course", "number": 1, "time_ms": 1077000, "distanc e_m": 320, "time_with_penalties_ms": 1077000, "gun_time_ms": {"timeInMillis": 2769000, "timeUnit": "m"}, "interval_full": true}, {"name": "20th Floor", "number": 2, "time_ms": 209000, "distance_m": 61, "time_with_penalties_ms": 209000, "gun_ time_ms": {"timeInMillis": 1900000, "timeUnit": "m"}, "interval_full": false}, {"name": "65th Floor", "number": 3, "time_ms": 785000, "distance_m": 229, "time_with_penalties_ms": 785000, "gun_time_ms": {"timeInMillis": 2476000, "timeUnit": " m"}, "interval_full": false}]}
I did not want to spend an long time fixing this, so first extracted all localities with some jq magic:
jq -r '[.locality | ascii_downcase]|.[]' empirestaterunup/results-2025.jsonl|sort -u
albany
albuquerque
alexandria
altamonte
ames
angier
armonk
astoria
athens
aventura
albany
albuquerque
alexandria
altamonte
ames
angier
armonk
astoria
athens
aventura
...
Next, using an AI LLM, I tried to use a reverse lookup of the country 2 letter ISO code with the locality, all in lowercase. Then wrote a small script to "fix" the country from the original dowloaded race results. For ambiguous locations I assumed the country was US, as the majority of racers from 2023-2024 where from this country.
[berkeley]
alpha-2 = "US"
[berlin]
alpha-2 = "DE"
[bethel]
alpha-2 = "US"
[bilbao]
alpha-2 = "ES"
Tutorial
Make sure you check the tutorial. It explains how this project got started, as well showcases features of the applications.
Running in server mode
The applications now support running in web server mode. To enable:
(EmpireStateRunUp) [josevnz@dmaf5 EmpireStateRunUp]$ esru_server --help
usage: esru_server [-h] --application {esru_numbers,esru_outlier,esru_browser} [--port PORT] [--debug] [results ...]
Browse user results
positional arguments:
results Race results.
options:
-h, --help show this help message and exit
--application {esru_numbers,esru_outlier,esru_browser}
Applications that can run in server mode: ['esru_numbers', 'esru_outlier', 'esru_browser']
--port PORT Default port (8000)
--debug Enable debug mode
esru_server --application esru_numbers
# Or if you have an external results file:
sru_server --application esru_browser empirestaterunup/results-2023.jsonl
Getting latest race results
I used athlinks-races to parse the race results. This is an example of a scrapping session:
uvx --from athlinks_races athlinks_races_cli --metadata_rpt /home/josevnz/EmpireStateBuildingRunUp/empirestaterunup/metadata-2025.json --athletes_rpt /home/josevnz/EmpireStateBuildingRunUp/empirestaterunup/results-2025.jsonl --format jsonlines --race_url https://www.athlinks.com/event/382111/results/Event/1124263/Results
uvx --from athlinks_races athlinks_races_cli --metadata_rpt /home/josevnz/EmpireStateBuildingRunUp/empirestaterunup/metadata-2024.json --athletes_rpt /home/josevnz/EmpireStateBuildingRunUp/empirestaterunup/results-2024.jsonl --format jsonlines --race_url https://www.athlinks.com/event/382111/results/Event/1093108/Results
uvx --from athlinks_races athlinks_races_cli --metadata_rpt /home/josevnz/EmpireStateBuildingRunUp/empirestaterunup/metadata-2023.json --athletes_rpt /home/josevnz/EmpireStateBuildingRunUp/empirestaterunup/results-2023.jsonl --format jsonlines --race_url https://www.athlinks.com/event/382111/results/Event/1062909/Results
Project details
Release history Release notifications | RSS feed
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 empirestaterunup-2025.1.0.tar.gz.
File metadata
- Download URL: empirestaterunup-2025.1.0.tar.gz
- Upload date:
- Size: 996.3 kB
- Tags: Source
- Uploaded using Trusted Publishing? Yes
- Uploaded via: twine/6.1.0 CPython/3.13.7
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
dc599d04bd4fc6aeef685ed721e53d2bfd470d1836deb67ecce5377fbaf9e3ec
|
|
| MD5 |
a34fa118cb2711c1262da7ed718ac9ab
|
|
| BLAKE2b-256 |
1096b6e3b21aee79cd727348a01d1ac838c21a02eed63771204379110838af57
|
Provenance
The following attestation bundles were made for empirestaterunup-2025.1.0.tar.gz:
Publisher:
pypi.yml on josevnz/EmpireStateBuildingRunUp
-
Statement:
-
Statement type:
https://in-toto.io/Statement/v1 -
Predicate type:
https://docs.pypi.org/attestations/publish/v1 -
Subject name:
empirestaterunup-2025.1.0.tar.gz -
Subject digest:
dc599d04bd4fc6aeef685ed721e53d2bfd470d1836deb67ecce5377fbaf9e3ec - Sigstore transparency entry: 927276990
- Sigstore integration time:
-
Permalink:
josevnz/EmpireStateBuildingRunUp@5ebd2456ee4bc9d0b30cad0d6f76aa0018de61f7 -
Branch / Tag:
refs/tags/2025 - Owner: https://github.com/josevnz
-
Access:
public
-
Token Issuer:
https://token.actions.githubusercontent.com -
Runner Environment:
github-hosted -
Publication workflow:
pypi.yml@5ebd2456ee4bc9d0b30cad0d6f76aa0018de61f7 -
Trigger Event:
push
-
Statement type:
File details
Details for the file empirestaterunup-2025.1.0-py3-none-any.whl.
File metadata
- Download URL: empirestaterunup-2025.1.0-py3-none-any.whl
- Upload date:
- Size: 994.8 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? Yes
- Uploaded via: twine/6.1.0 CPython/3.13.7
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
371bed649c6b3f7c8b6ccce9294ce990870441e88563f59079b1d6770786aa16
|
|
| MD5 |
ef7a58ce87b24ceeae3d062b6a7f285f
|
|
| BLAKE2b-256 |
9ff651f2fae189c7c0d31329f24f3616ea08c078837b2c15cc07a809462caeea
|
Provenance
The following attestation bundles were made for empirestaterunup-2025.1.0-py3-none-any.whl:
Publisher:
pypi.yml on josevnz/EmpireStateBuildingRunUp
-
Statement:
-
Statement type:
https://in-toto.io/Statement/v1 -
Predicate type:
https://docs.pypi.org/attestations/publish/v1 -
Subject name:
empirestaterunup-2025.1.0-py3-none-any.whl -
Subject digest:
371bed649c6b3f7c8b6ccce9294ce990870441e88563f59079b1d6770786aa16 - Sigstore transparency entry: 927276991
- Sigstore integration time:
-
Permalink:
josevnz/EmpireStateBuildingRunUp@5ebd2456ee4bc9d0b30cad0d6f76aa0018de61f7 -
Branch / Tag:
refs/tags/2025 - Owner: https://github.com/josevnz
-
Access:
public
-
Token Issuer:
https://token.actions.githubusercontent.com -
Runner Environment:
github-hosted -
Publication workflow:
pypi.yml@5ebd2456ee4bc9d0b30cad0d6f76aa0018de61f7 -
Trigger Event:
push
-
Statement type: