-
Notifications
You must be signed in to change notification settings - Fork 0
Home
steam is a Python client for the Steam network — CM protocol, PICS / CDN, WebAuth, Web API, Steam Guard, SteamIDs, master-server queries.
This is a maintained fork of ValvePython/steam, living at H47R15/steam. Upstream is largely inactive; this fork exists to keep the library working against modern Python and current Steam wire protocols. See Fork Changes for a detailed diff of what's different.
- Python 3.13+ only. Legacy py2 / py<3.4 compat shims removed.
- Modern protobuf 5.26+ / 6.x runtime, freshly regenerated
_pb2files from current.protosources. - Full
.pyitype stubs for every generated protobuf module —msg.fieldaccesses type-check under Pylance / pyright. -
Poetry-first workflow. Regeneration steps registered as
poetry run pb-*console scripts. - Bug fixes latent in upstream, surfaced while porting (see the README for details).
Install:
git clone https://github.com/H47R15/steam.git
cd steam
poetry install --with dev --extras clientThe shortest complete script — anonymous PICS lookup for Helldivers 2 (553850):
from steam.client import SteamClient
client = SteamClient()
assert client.anonymous_login()
resp = client.get_product_info(apps=[553850], timeout=15)
print(resp['apps'][553850]['common']['name'])
client.logout()
client.disconnect()Walk through this snippet line by line on the First script page.
-
SteamClient — CM protocol client on top of gevent. Login flows (password / refresh-token / anonymous), PICS product info, friends list, chat, game-coordinator hooks.
-
PICS — the batched app / package metadata catalogue, reached through
SteamClient.get_product_info. Includes a comparison of PICS vs. store HTTP vs. Web API for picking the right surface.
-
PICS — the batched app / package metadata catalogue, reached through
-
AsyncSteamClient (new in 1.6) —
asynciofacade aroundSteamClientfor FastAPI / TaskIQ / any asyncio app. Runs the sync client on a dedicated daemon thread with its own gevent hub — the asyncio process is never monkey-patched. Auto-reconnect, typed exceptions, event bridge, cancellation, status/metrics hooks.- Pool — multi-account variant for concurrent connections.
-
FastAPI Integration —
lifespan+Dependshelpers. -
TaskIQ Integration — broker startup hook +
TaskiqDependsprovider. - MCP — expose the client as Model-Context-Protocol tools an LLM agent can call. FastMCP adapter included.
- CDNClient — content-depot downloads with manifest parsing.
-
WebAuth / MobileWebAuth — obtain authenticated
requests.Sessioncookies forstore.steampowered.com/steamcommunity.com. -
WebAPI — thin wrapper around Steam's
api.steampowered.comwith dynamic interface discovery. - SteamAuthenticator — enable / disable / verify Steam Guard 2FA.
-
SteamID — parse and convert between 32-bit / 64-bit /
STEAM_X:Y:Z/ community-URL representations. -
Master Server Queries — query masters directly or through
SteamClient.
-
Installation — Poetry setup,
clientextra,protoc. - First script — walk through the anonymous PICS example and a WebAPI-only variant.
- Pick a topic from the sidebar. Every feature has its own page.
Steam changes protobufs periodically. When they do:
poetry run pb-updateThat runs fetch → compile → services → gen-enums in sequence. Fine-grained control and troubleshooting live on the Regenerating Protobufs page.
poetry run pytest # ~83 tests, ~1s, no internet required
poetry run pytest -k webapi # filter subsetWeb-facing tests replay VCR cassettes from vcr/*.yaml — see Contributing for the regeneration recipe when Steam responses drift.
- Never touched a Steam client library before? Read First script, then SteamClient.
- Building a FastAPI / TaskIQ / MCP service? Jump to AsyncSteamClient, then the framework page you need — FastAPI, TaskIQ, or MCP.
- Running multiple Steam accounts in one process? Pool.
- Downloading depot files? Jump straight to CDNClient.
- Just need to hit
api.steampowered.com? WebAPI is standalone — no gevent, no client extra needed. - Building anything that hits Steam's login flow? WebAuth and SteamAuthenticator cover the mobile-2FA path.
- Contributing back or resyncing with upstream? Contributing and Fork Changes have the process.
- Still confused? The FAQ answers the top questions we get.
H47R15/steam — maintained fork of ValvePython/steam. MIT licensed.