srcomapipy
A python library for the speedrun.com API
Install
pip install srcomapipy
Examples
Find a game:
from srcompaipy.srcomapipy import SRC
import srcomapipy.srctypes as st
api = SRC(user_agent="username")
# search for a game
games: list[st.Game] = api.search_game("Batman: Arkham City")
print(games)
>>> [<Game: Batman: Arkham City (x3692ldl)>, <Game: Batman: Arkham City Lockdown (9d3808w1)>, <Game: Batman: Arkham City Category Extensions (m1mnnv3d)>]
# get newly submitted runs for a game
bac: st.Game = games[0]
runs: list[st.Run] = api.get_runs(game_id=bac.id, status="new")
Get WR of a specific leaderboard:
# get category and it's variables
cat = bac.categories["Any%"]
var1 = cat.variables["Version"]
var2 = cat.variables["Difficulty"]
lb = api.get_leaderboard(bac, cat, variables=[(var1, "PC"), (var2, "NG+")])
print(lb.wr())
>>> <Run: RTA-14:30.000 (yox7rk5y)-Any%-'Version'=PC 'Difficulty'=NG+ by Bepsi>
Search for specific user:
users: list[st.User] = api.get_users(lookup="username")
Exception example:
try:
game: st.Game = api.get_game(game_id="id")
except st.SRCAPIException as e:
print(f"Error: {e.message}")
Change run status (Requires API Key of a moderator):
api = SRC(user_agent="username", api_key="api-key-here")
bac: st.Game = api.search_game("Batman: Arkham City")[0]
# reject a new run
runs: list[st.Run] = api.get_runs(game_id=bac.id, status="new")
# returns the run that was changed
run: st.Run = api.change_run_status(runs[0], status="rejected", reason="reason")
Metadata
Release files for srcomapipy 0.5.5
For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.
Source distribution (sdist)
| File | Size | Uploaded | Provenance | Actions |
|---|---|---|---|---|
| srcomapipy-0.5.5.tar.gz | 13.3 kB | Without provenance | Details for srcomapipy-0.5.5.tar.gz |
Built distribution (wheel)
| File | Interpreter | ABI | Platform | Actions Reset |
|---|---|---|---|---|
| srcomapipy-0.5.5-py3-none-any.whl | Python 3 | none | any | Details for srcomapipy-0.5.5-py3-none-any.whl |
Total release size: 26.2 kB
Release files / srcomapipy-0.5.5.tar.gz
| Download URL | srcomapipy-0.5.5.tar.gz |
|---|---|
| Size | 13.3 kB |
| Tags | Source |
|
SHA-256 checksum How to use checksums |
6fa45139e330b9b8b3bfa1bb013d2a770c21512311ad0a1494ce3a0dc8456c98
|
|
BLAKE2b-256 checksum How to use checksums |
298f2d273359be42c1d83140e5290aa7227f4a0b896ce19ecedef0f8fa89203b
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
twine/5.1.1 CPython/3.12.1
|
Release files / srcomapipy-0.5.5-py3-none-any.whl
| Download URL | srcomapipy-0.5.5-py3-none-any.whl |
|---|---|
| Size | 13.0 kB |
| Tags | Python 3 |
|
SHA-256 checksum How to use checksums |
6182c9428104c7dfb4f0fb85dcfa2aac67fceacb152056d4052c278fe5827b25
|
|
BLAKE2b-256 checksum How to use checksums |
f9a08c0e09edd07859511415a1baada6d2c05c14394bb60adf5eadabaa90bff5
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
twine/5.1.1 CPython/3.12.1
|
Security for srcomapipy 0.5.5
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.
No provenance found
None of the files in this release were uploaded with provenance metadata.
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.