Python bindings for Valve's Steamworks SDK, built on ctypes: no compiled extension and no
runtime dependencies.
Status: early development. The package can initialize and shut down Steam but exposes no Steamworks interfaces yet, and is not published on PyPI.
- Raw bindings generated from the SDK's metadata and headers, mirroring the flat C API.
- A small runtime that loads the native library, manages initialization and shutdown, and dispatches callbacks.
- Pythonic APIs for achievements, cloud saves, matchmaking, networking and the Workshop.
- Windows, Linux and macOS, verified against each platform's struct layout.
- 64-bit CPython 3.11 or newer
- Windows, Linux or macOS
- The Steamworks SDK, downloaded from Valve
The SDK is proprietary. This repository and its packages contain no SDK headers, metadata or native libraries. Download the SDK from the Steamworks partner site and use it under Valve's terms; your game ships the SDK's redistributable library itself.
import pysteamsdk
pysteamsdk.init()
try:
...
finally:
pysteamsdk.shutdown()init()loads the Steamworks library from the path you pass, thenPYSTEAMSDK_LIB, then the folder of your script or frozen executable, then the working directory. Copy it from the SDK'sredistributable_binfolder.- Steam must be running and logged in. Steam supplies the app ID when it launches your game;
outside Steam, put a
steam_appid.txtcontaining the ID in the working directory. pysteamsdk never writes that file or sets environment variables for you. - Failures raise
pysteamsdk.errors.InitError, or its subclassesNoSteamClientErrorandVersionMismatchError; the message includes Steam's own explanation. - Steam can be initialized once per process.
shutdown()may be called repeatedly, butinit()aftershutdown()raisesLifecycleError: Valve does not document initializing again. init()andshutdown()are safe to call from several threads, but pysteamsdk cannot see Steam calls made by other code; stop those before callingshutdown().
See CONTRIBUTING.md.
pysteamsdk's own source code is released under the Apache License 2.0. The Steamworks SDK is licensed separately by Valve. Bindings derived from the SDK will be published only after a redistribution review.
Steam is a trademark of Valve Corporation. This project is not affiliated with or endorsed by Valve.