Steam odds and ends
Steamodd is a comprehensive Python library designed to interface with the Steam API, providing a simplified and easy to use set of tools for developers to access and manage the Steam API.
- Steam API interface wrappers: Interact with the various endpoints of the Steam API.
- Steam inventory manager (SIM): Manage and manipulate Steam user inventory data.
- VDF serializer: Convert Valve Data Format (VDF) files to Python dictionaries and vice versa.
- Python 3+
Install via pip for easy access (ideally within a virtual environment):
$ pip install steamodd
For manual installation, use the standard setuptools module:
$ python setup.py install
After installation, you can import steamodd
into your Python project and start interacting with the Steam API. Make sure to have a valid Steam API key for actions that need authentication.
from steam.api import interface
# Fetch games of user with id 76561198017493014 and include all application information
games = interface('IPlayerService').GetOwnedGames(steamid=76561198017493014, include_appinfo=1)
# Accessing game count
print(games['response']['game_count']) # Output: 249
from steam.apps import app_list
apps = app_list()
# Check if a game is in the app list
print('Dota 2' in apps) # Output: True
from steam.items import inventory, schema
# Fetching inventory for a given app id, e.g., Dota 2 with id 570
inv = inventory(76561198017493014, 570)
# Iterating over inventory items
for item in inv:
print(item.name)
# Fetching and working with item schema
item_schema = schema(440) # Team Fortress 2
for item in item_schema:
if item.name == 'Defiant Spartan':
print(item.type) # Output: 'Hat'
For more detailed information and advanced usage, refer to the full documentation.
To run the test suite, execute the following command:
python setup.py run_tests -k YOUR_STEAM_API_KEY
Contributions are welcome! If you have improvements or bug fixes, please send a pull request.
Encountered a bug or have a feature idea? Open an issue on GitHub.