Skip to main content

Python API wrapper for biathlonresults.com

example workflow

Installation

pip install biathlonresults

Examples

Get WC 2024/2025 stages and races:

import biathlonresults
events = biathlonresults.events("2425", level=biathlonresults.consts.LevelType.BMW_IBU_WC)
for event in events:
    print(event["ShortDescription"], event["StartDate"][:10], "-", event["EndDate"][:10])
    for race in biathlonresults.competitions(event["EventId"]):
        print("   ", race["RaceId"], race["ShortDescription"], race["StartTime"])
# output:
# Kontiolahti 2024-11-27 - 2024-12-08
#     BT2425SWRLCP01MXSR Single Mixed Relay (W+M) 2024-11-30T12:15:00Z
#     BT2425SWRLCP01MXRL Mixed Relay (W+M) 2024-11-30T14:45:00Z
#     BT2425SWRLCP01SMRL Men 4x7.5km Relay 2024-12-01T12:45:00Z
#     BT2425SWRLCP01SWRL Women 4x6km Relay 2024-12-01T16:25:00Z
#     BT2425SWRLCP01SMSI Men 15km Short Individual 2024-12-03T15:20:00Z
#     BT2425SWRLCP01SWSI Women 12.5km Short Individual 2024-12-04T15:20:00Z
# ...

Get race results:

import biathlonresults
race_results = biathlonresults.results(race_id="BT2425SWRLCP01SWSI")
for result in race_results['Results']:
    print(result["Rank"], result["ShortName"], result["Nat"], result["Shootings"], result["TotalTime"] if result["Rank"] == "1" else result["Behind"])
# output:    
# 1 JEANMONNOT L. FRA 0+0+0+0 35:52.3
# 2 HALVARSSON E. SWE 0+1+0+0 +12.3
# 3 OEBERG E. SWE 0+1+1+1 +56.4
# ...

Find athlete:

import biathlonresults
athletes = biathlonresults.athletes(family_name='bo', given_name='jo')
for i in athletes['Athletes']:
    print(i['IBUId'], i['FamilyName'], i['GivenName'])
# output:
# BTNOR11605199301 BOE Johannes Thingnes
# BTNOR11806199901 BOTN Johan-Olav

Get last races of athlete:

import biathlonresults
res = biathlonresults.all_results('BTNOR11605199301')
for i in res['Results']:
    print(i["RaceId"], i['Comp'], i['Season'], i['Place'], i['Rank'])
# output:
# BT2425SWRLCP03SMMS MS 24/25 Annecy 3.
# BT2425SWRLCP03SMPU PU 24/25 Annecy 1.
# BT2425SWRLCP03SMSP SP 24/25 Annecy 2.
# ...

Race analytics:

import biathlonresults
race_course_analytics = biathlonresults.analytic_results("BT2425SWRLCP01SWMS", type_id=biathlonresults.consts.AnalysisType.TOTAL_COURSE_TIME)
for result in race_course_analytics["Results"]:
    print(result["Rank"], result["Name"], result["TotalTime"] if result["Rank"] == "1" else result["Behind"])
# output:
# 1 OEBERG Elvira 31:20.7
# 2 BRAISAZ-BOUCHET Justine +17.0
# 3 PREUSS Franziska +20.1
# ...

World Cup Scores:

import biathlonresults
cups = biathlonresults.cups("2425")
for cup in cups:
    if cup["Level"] == biathlonresults.consts.LevelType.BMW_IBU_WC:
        print(cup["CupId"], cup["Description"])
# output:
# BT2425SWRLCP__SWTS Women's World Cup Total Score
# BT2425SWRLCP__SWSP Women's World Cup Sprint Score
# BT2425SWRLCP__SWPU Women's World Cup Pursuit Score
# ...

total_score_women = biathlonresults.cup_results("BT2425SWRLCP__SWTS")
for row in total_score_women['Rows']:
    print(row["Rank"], row["IBUId"], row["Name"], row["Nat"], row["Score"])
# output:
# 1 BTGER21103199401 PREUSS Franziska GER 565
# 2 BTSWE22602199901 OEBERG Elvira SWE 371
# 3 BTFRA22810199801 JEANMONNOT Lou FRA 352
# ...

see more examples here

Donations

"Buy Me A Coffee"

BTC: bc1qfwe3ysmcklnujhyqfkh7japzyunvpk46h2a8ps

ETH: 0xAc41D8DbD12d96936344806F2a42f83E0Ea4Aad1

Metadata

Release files for biathlonresults 0.1

For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.

Source distribution (sdist)

Source distribution for biathlonresults 0.1
File Size Uploaded Provenance
biathlonresults-0.1.tar.gz 5.9 kB With provenance Details

Built distribution (wheel)

Table of built distributions (wheels) for biathlonresults 0.1
File Interpreter ABI Platform
biathlonresults-0.1-py3-none-any.whl Python 3 none any Details

Total release size: 12.2 kB

Release files / biathlonresults-0.1.tar.gz

Download URL biathlonresults-0.1.tar.gz
Size 5.9 kB
Tags Source
SHA-256 checksum
How to use checksums
ac523988898de1bf3913d5cd3dc79186b848a489acaf4b1f9272331e428c890a
BLAKE2b-256 checksum
How to use checksums
6d9c8bab1f40f1a6aa1ed5b9932f60ab165781333d5542ca77b212380a016dfd
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
Yes
Uploaded via twine/6.0.1 CPython/3.12.8

Provenance

Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.

PyPI Publish Attestation

PyPI verified that this artifact, at this checksum, originated from the publisher listed below.

Signed by GitHub Actions, verified by PyPI on Dec 25, 2024.

Transparency log

Release files / biathlonresults-0.1-py3-none-any.whl

Download URL biathlonresults-0.1-py3-none-any.whl
Size 6.4 kB
Tags Python 3
SHA-256 checksum
How to use checksums
8bea75be6b14f8b2fac34cf75f81a576319372b8993337c141fcbde2891a5dfc
BLAKE2b-256 checksum
How to use checksums
51070756ceff629d51254c8fbd7bf5b30c79e57e65ed2200d7534b4b1d083f40
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
Yes
Uploaded via twine/6.0.1 CPython/3.12.8

Provenance

Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.

PyPI Publish Attestation

PyPI verified that this artifact, at this checksum, originated from the publisher listed below.

Signed by GitHub Actions, verified by PyPI on Dec 25, 2024.

Transparency log

Security for biathlonresults 0.1

Provenance

Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.

Full provenance

All 2 files in this release have been uploaded with provenance metadata.

Select from 2 files

Attestation for biathlonresults-0.1.tar.gz

PyPI Publish Attestation

PyPI verified that this artifact, at this checksum, originated from the publisher listed below.

Signed by GitHub Actions, verified by PyPI on Dec 25, 2024.

Transparency log

A note on package security

PyPI is a repository for distributing packages, not a service for auditing them. While third-party security researchers and our staff do their best to detect and remove malicious packages, PyPI cannot guarantee the quality, security or suitability of any given package.

To learn more about protecting yourself from malicious actors, visit our package security documentation.

Anthropic, PBC Visionary sponsor Bloomberg Visionary sponsor Hudson River Trading Visionary sponsor Meta Visionary sponsor NVIDIA Visionary sponsor Microsoft Sustainability sponsor Depot Continuous Integration AWS Cloud computing and Security Sponsor Datadog Monitoring Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page