/  Blog /
EnglishPython - Extract Steamgames

Python - Extract Steamgames

Eingetragen: 24.08.2023

Python Script: The script has the task of extracting data from the previously saved game list of your own Steam account and writing it to a text file. Extracted titles are sorted alphabetically and the created file is given a date.

For large collections, this can be helpful to keep an eye on your own titles and DLCs.

An existing installation of Python is required

First of all, the Steam server must call up and save its own game list in XML format. For the following explanation it is assumed that the files are located in the folder "c :\game list" You can of course freely choose the storage location.
  1. Go to link:

    Replace XXX with your own ID. You can see your own ID in the URL line of your Steam profile.

    My XML file can be found as an example via ""

  2. Right click, save page as ""
  3. and save the Python script. e.g. as ""

  4.  import xml.etree.ElementTree as ET
    import os.path
    import datetime

    # Step 1: Reading XML file
    tree = ET.parse('')
    root = tree.getroot()

    # Step 2: Extract SteamID
    steam_id = root.find('steamID').text

    # Step 3: Determine modification date of file ''
    mod_time = os.path.getmtime('')
    mod_date = datetime.datetime.fromtimestamp(mod_time).strftime('%d-%m-%Y')

    # Step 4: Create and write file for the found games
    output_filename = f'{steam_id}-Steamgames-{mod_date}.txt'

    with open(output_filename, 'w', encoding='utf-8') as output_file:
    # Step 5: Extract heading and games and write sorted into the file
    game_list = sorted([game.find('name').text for game in root.findall('.//game')])
    output_file.write(f'Steamgames from {steam_id} - Date: {mod_date}\n\n')

    # Optional screen feedback
    print(f'The games were saved in "{output_filename}".')

  5. Move the "" and "" you just created to the "c :\game list" folder
  6. Launch the Windows Command Prompt (CMD) via the "Windows + R key" or via the Start menu and enter "cmd"
  7. Navigate to folder "c :\game list" enter and confirm the following


The script runs, reading the data from the "" and summarizes the results alphabetically in a text file. In my case, the "ペンギン -Steamspiele-14-08-2023.txt" would list 6979 purchased products that are currently in my own Steam library.

Alternate download of the script (1.02 KB)
Date: 2023-09-05
CRC32 Hash: bff15c2e
SHA-256 Hash: ba166678a18d40299ba1eea14f49846d715f337521864c5b900482d6881f343b



  Rules for posting comments can be found in the F.A.Q.