Skip to main content

Steam client library for Python

Project description

Steam Client

A Python library for interacting with a locally installed Steam client — enumerate your game library/non-steam games, read game metadata and artwork paths, and send Steam URI commands.

Docs

Buy Me a Coffee Ko-fi


Installation

Requires Python 3.11+.

pip install steam-client

Or install from source:

pip install -e .

Quickstart

from steam_client.steam import Steam

steam = Steam()  # Uses default path: C:\Program Files (x86)\Steam

# On Windows, auto-detect path from registry:
from steam_client.utils import steam_from_registry
steam = steam_from_registry()

Common Operations

List all installed games

for game in steam.library.games():
    print(game.appid, game.name)

Find a game

game = steam.library.game_by_id("440")       # by app ID
game = steam.library.game_by_name("Portal 2") # by name (case-insensitive)

Artwork paths

game.header   # Path to header image    (460×215 jpg)
game.grid     # Path to grid image      (600×900 jpg)
game.hero     # Path to hero image
game.icon     # Path to icon file, or None

Launch and manage games via Steam URI commands

from steam_client import commands
from steam_client.commands import SteamWindow

commands.run_game_id("440")               # Launch a game
commands.store("440")                     # Open store page
commands.install("440")                   # Prompt install
commands.uninstall("440")                 # Prompt uninstall
commands.open_window(SteamWindow.FRIENDS) # Open a Steam window
commands.open_url("https://store.steampowered.com")

Or launch a game directly from a Game object:

game.run()

Users and shortcuts

for user in steam.users:
    print(user.user.data.PersonaName)

for shortcut in steam.library.shortcuts():
    print(shortcut.name)

If Steam is not installed at the given path, calls that read Steam data raise steam_client.SteamNotFoundError.

Platform Notes

Platform Path Registry helper
Windows C:\Program Files (x86)\Steam (default) steam_from_registry()
Linux Pass yours, e.g. ~/.local/share/Steam Not available

Pass a custom path to override the default:

steam = Steam("/custom/steam/path")

Requires read access to local Steam config files (libraryfolders.vdf, shortcuts.vdf, appmanifest files).


Development

pytest          # Run tests
flake8 steam_client  # Lint
mypy steam_client    # Type check
mkdocs serve         # Preview docs locally
mkdocs build --strict # Validate docs build
tox             # Run all environments (lint, type, docs, py311–314)

bump-my-version show current_version   # Show current version
bump-my-version bump patch             # 4.0.0 → 4.0.1
bump-my-version bump minor             # 4.0.0 → 4.1.0
bump-my-version bump major             # 4.0.0 → 5.0.0

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

steam_client-6.0.0.tar.gz (17.0 kB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

steam_client-6.0.0-py3-none-any.whl (13.3 kB view details)

Uploaded Python 3

File details

Details for the file steam_client-6.0.0.tar.gz.

File metadata

  • Download URL: steam_client-6.0.0.tar.gz
  • Upload date:
  • Size: 17.0 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? Yes
  • Uploaded via: twine/6.1.0 CPython/3.13.12

File hashes

Hashes for steam_client-6.0.0.tar.gz
Algorithm Hash digest
SHA256 6248c140f7751b35c81a8799a7484cc8707235a434da1c69b647a3afcb8da764
MD5 5564628bc095c33b89ee4b0988e52df9
BLAKE2b-256 1dd4bccb22a044a3a7ba057f91250b5fb95351b3663eca5c3f069c6c6b5ce33d

See more details on using hashes here.

Provenance

The following attestation bundles were made for steam_client-6.0.0.tar.gz:

Publisher: release-please.yaml on Garulf/Steam-Client

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

File details

Details for the file steam_client-6.0.0-py3-none-any.whl.

File metadata

  • Download URL: steam_client-6.0.0-py3-none-any.whl
  • Upload date:
  • Size: 13.3 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? Yes
  • Uploaded via: twine/6.1.0 CPython/3.13.12

File hashes

Hashes for steam_client-6.0.0-py3-none-any.whl
Algorithm Hash digest
SHA256 25f7cecd3e3b1fbbc4aa1a43defc4a9716b647c921ddbf280a1a56f82d2da931
MD5 58bafe3f8fe12e4f9ad26a2cca9e5ef7
BLAKE2b-256 03b1d371e89e48e7c799e1ab5d6661597a1f9f12a70f265a28b368bcd51869de

See more details on using hashes here.

Provenance

The following attestation bundles were made for steam_client-6.0.0-py3-none-any.whl:

Publisher: release-please.yaml on Garulf/Steam-Client

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Pingdom Monitoring Sentry Error logging StatusPage Status page