Async Python client for the OverFast API (Overwatch data).
Project description
overfast-client
Async Python client for the OverFast API — comprehensive Overwatch data (heroes, maps, gamemodes, player stats) via a typed, pydantic-backed interface.
Install
pip install overfast-client
The PyPI distribution is
overfast-client; the import name isoverwatch_py.
Or from source (editable):
pip install -e .
Quick start
import asyncio
from overwatch_py import Client
from overwatch_py.enums import Hero, Locale, Role, HeroGamemode, PlayerGamemode, Platform
async def main():
client = Client()
# List heroes
heroes = await client.get_heroes(role=Role.SUPPORT, locale=Locale.EN_US)
for h in heroes:
print(h.key, h.name)
# Full hero data (abilities, story, hitpoints, ...)
ana = await client.get_hero_data(Hero.ANA)
print(ana.hitpoints, len(ana.abilities))
# Maps & gamemodes
maps = await client.get_maps()
gamemodes = await client.get_gamemode_details()
# Hero usage stats (pickrate / winrate)
stats = await client.get_heroes_stats(
platform=Platform.PC,
gamemode=PlayerGamemode.COMPETITIVE,
)
# Players
result = await client.search_players("TeKrop", limit=10)
player = await client.get_player(result.results[0].player_id)
summary = await client.get_player_summary("TeKrop-2217")
stats_summary = await client.get_player_stats("TeKrop-2217", gamemode=PlayerGamemode.COMPETITIVE)
asyncio.run(main())
Configuration
from overwatch_py import Client
from overwatch_py.config import Config
from overwatch_py.session import HTTPSession
config = Config(
timeout=10, # seconds
retries=3, # retries on 5xx
cache=True, # HTTP-level cache (hishel), respects server Cache-Control
cache_backend="sqlite", # "memory" | "sqlite" | "file"
)
client = Client(HTTPSession(config))
Caching
Caching is disabled by default. When enabled, hishel sits in the httpx transport stack and honors each endpoint's Cache-Control / Age headers (e.g. /heroes is cached ~1 day, /heroes/stats ~1 hour by the upstream API).
Exceptions
All non-2xx responses map to subclasses of APIError:
| Status | Exception |
|---|---|
| 400 | BadRequestError |
| 404 | NotFoundError |
| 422 | ValidationError |
| 429 | APIRateLimitError |
| 500 | InternalServerError |
| 503 | BlizzardRateLimitError |
| 504 | BlizzardServerError |
from overwatch_py.exceptions import NotFoundError, APIRateLimitError
try:
await client.get_player_summary("does-not-exist-1234")
except NotFoundError:
...
except APIRateLimitError as e:
print("rate limited:", e.response.headers.get("retry-after"))
API surface
Exposed on Client:
- Heroes —
get_heroes,get_hero_data,get_heroes_stats - Maps / Gamemodes —
get_maps,get_gamemode_details - Players —
search_players,get_player,get_player_summary,get_player_stats,get_player_career_stats,get_player_career_stats_with_labels,get_player_full_stats
The underlying services (client.heros, client.maps, client.players) are also available if you prefer service-level access.
Development
pip install -e ".[dev]"
pytest # unit + mocked HTTP tests
pytest -m live # hits the real API (rate-limited)
pytest -m 'live or not live' # run everything
License
MIT.
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 overfast_client-0.1.0.tar.gz.
File metadata
- Download URL: overfast_client-0.1.0.tar.gz
- Upload date:
- Size: 43.7 kB
- Tags: Source
- Uploaded using Trusted Publishing? Yes
- Uploaded via: twine/6.1.0 CPython/3.13.12
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
51f1e5e87e194a18e864d4f63ea02a533a2121079a9d94962ef22239862ee939
|
|
| MD5 |
66ff7ad9c5bccb609af61f77da6d6b8b
|
|
| BLAKE2b-256 |
34b8bc88d1ab463627897edf0cb0a8b6f9cba9610ca99512194cf84a31759efe
|
Provenance
The following attestation bundles were made for overfast_client-0.1.0.tar.gz:
Publisher:
publish.yml on Leo890728/overwatch_py
-
Statement:
-
Statement type:
https://in-toto.io/Statement/v1 -
Predicate type:
https://docs.pypi.org/attestations/publish/v1 -
Subject name:
overfast_client-0.1.0.tar.gz -
Subject digest:
51f1e5e87e194a18e864d4f63ea02a533a2121079a9d94962ef22239862ee939 - Sigstore transparency entry: 1294934928
- Sigstore integration time:
-
Permalink:
Leo890728/overwatch_py@5fdfe76788180725fc59bbe0d321cfb3f76378f6 -
Branch / Tag:
refs/tags/v0.1.0 - Owner: https://github.com/Leo890728
-
Access:
public
-
Token Issuer:
https://token.actions.githubusercontent.com -
Runner Environment:
github-hosted -
Publication workflow:
publish.yml@5fdfe76788180725fc59bbe0d321cfb3f76378f6 -
Trigger Event:
push
-
Statement type:
File details
Details for the file overfast_client-0.1.0-py3-none-any.whl.
File metadata
- Download URL: overfast_client-0.1.0-py3-none-any.whl
- Upload date:
- Size: 20.1 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? Yes
- Uploaded via: twine/6.1.0 CPython/3.13.12
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
43d1f314448d7f2458b906b5a0605a08e782a8bf74a2df728283951a59f668a7
|
|
| MD5 |
ca7e88a1e97660d61e932f879acab13c
|
|
| BLAKE2b-256 |
f475549d8ca699919931d0df1d30a597a00ce8e7ef52d96f7a57f34bd53d837d
|
Provenance
The following attestation bundles were made for overfast_client-0.1.0-py3-none-any.whl:
Publisher:
publish.yml on Leo890728/overwatch_py
-
Statement:
-
Statement type:
https://in-toto.io/Statement/v1 -
Predicate type:
https://docs.pypi.org/attestations/publish/v1 -
Subject name:
overfast_client-0.1.0-py3-none-any.whl -
Subject digest:
43d1f314448d7f2458b906b5a0605a08e782a8bf74a2df728283951a59f668a7 - Sigstore transparency entry: 1294935019
- Sigstore integration time:
-
Permalink:
Leo890728/overwatch_py@5fdfe76788180725fc59bbe0d321cfb3f76378f6 -
Branch / Tag:
refs/tags/v0.1.0 - Owner: https://github.com/Leo890728
-
Access:
public
-
Token Issuer:
https://token.actions.githubusercontent.com -
Runner Environment:
github-hosted -
Publication workflow:
publish.yml@5fdfe76788180725fc59bbe0d321cfb3f76378f6 -
Trigger Event:
push
-
Statement type: