Skip to main content

Steam Client API

Project description

Steam Client API

A Python 3.8 library for Steam shortcuts. Get app IDs, manage custom artwork, and more!

Installation

The package is available on PyPi and can be installed with pip.

pip install steamclient

Usage

Documentation | Example

>>> import steamclient

>>> # Get a shortcut from the user that last logged in
>>> users = steamclient.get_users()
>>> shortcut = users[0].shortcuts[23]

>>> # Print shortcut info
>>> shortcut.info()

Shortcut 23
    id: 2361552855
    name: The Outer Worlds
    exe: "C:\\Games\\The Outer Worlds\\TheOuterWorlds.exe"
    start_dir: "C:\\Games\\The Outer Worlds\\"
    icon: ""
    shortcut_path: ""
    launch_options: ""
    hidden: False
    allow_desktop_config: True
    allow_overlay: True
    openvr: False
    devkit: False
    devkit_game_id:
    last_play_time: b'\x02\x96\xbf]'
    tags: []

>>> # Get the paths to custom artwork
>>> shortcut.logo
'C:\\Program Files (x86)\\Steam\\userdata\\82279028\\config\\grid\\2361552855_logo.png'
>>> shortcut.hero
'C:\\Program Files (x86)\\Steam\\userdata\\82279028\\config\\grid\\2361552855_hero.png'
>>> shortcut.grid
'C:\\Program Files (x86)\\Steam\\userdata\\82279028\\config\\grid\\2361552855p.png'

>>> # Set artwork for a game or shortcut with a file or a url
>>> shortcut.set_logo(filepath='C:\\Games\\Steam Grid\\logo.png')
>>> shortcut.set_grid(url='https://gitlab.com/avalonparton/grid-beautification/raw/master/Games/Untitled%20Goose%20Game/Lake.png')

>>> # Get the paths to local Steam libraries
>>> libraries = steamclient.get_libraries() 
['C:\\Program Files (x86)\\Steam', 'D:\\Games\\Steam Library', 'G:\\Steam Library']

>>> # Get all installed Steam Games in one library
>>> user.games(libraries[:1])
[<Game Brawlhalla (291550)>, <Game Castle Crashers (204360)>, <Game Destiny 2 (1085660)>, <Game Dota 2 (570)>, <Game Generation Zero (704270)>, <Game Rocket League (252950)>, <Game SteamVR (250820)>, <Game Steamworks Common Redistributables (228980)>, <Game Team Fortress 2 (440)>, <Game The Binding of Isaac (113200)>]


>>> # Create a new shortcut
>>> user.add_shortcut(name="Pistol Whip", exe="C:/Games/Pistol Whip.exe", openvr=True, tags=["VR"])

Changelog

1.2

  • Fix user detection (ignore ac and 0 folders in Steam/userdata/)

0.9

  • Don't open binary files with utf-8 encoding

0.8

  • Broken! Don't use this version!
  • Open files with utf-8 encoding to try and fix a bug

0.7

  • Added User.owned_games(include_free=False)
    • Optional argument controls inclusion of played free games
  • Raises an exception if Game.set_logo() Game.set_hero() or Game.set_grid() is called without any parameters

0.4

  • Added User.comm_id for getting a user's STEAM64id
  • bugfix: Creates custom artwork folder if missing

0.3

  • Added create_shortcut_entry(shortcut) and add_shortcut_entry(entry) functions
  • Added attributes to Game and Shortcuts: .has_hero .has_logo .has_grid

0.2

  • Added set_logo(), set_hero(), and set_grid() functions to Games and Shortcuts

0.1

  • Initial release

Project details


Download files

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

Source Distributions

No source distribution files available for this release.See tutorial on generating distribution archives.

Built Distribution

steamclient-1.2-py3-none-any.whl (8.1 kB view details)

Uploaded Python 3

File details

Details for the file steamclient-1.2-py3-none-any.whl.

File metadata

  • Download URL: steamclient-1.2-py3-none-any.whl
  • Upload date:
  • Size: 8.1 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/3.1.1 pkginfo/1.5.0.1 requests/2.24.0 setuptools/41.2.0 requests-toolbelt/0.9.1 tqdm/4.46.0 CPython/3.8.3

File hashes

Hashes for steamclient-1.2-py3-none-any.whl
Algorithm Hash digest
SHA256 5eb0a3816ef68743e697064570e911e2e7552048184fc2780e92e36dc8460e64
MD5 e4b10a42d3c1ec5614a5cfdd7417b457
BLAKE2b-256 acefd72af83a5679f051b6ba65a8d84462f923ed3f5ed3099bde78768f44366c

See more details on using hashes here.

Supported by

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