|
1 |
| -# SGL |
2 |
| -Steam Games Library (SGL) is an automated tool for collecting Steam library data with export to Google Sheets. |
| 1 | +# Steam Games Library (SGL) |
| 2 | + |
| 3 | +Automatic data collector of your Steam library with export to Google Sheets. The service collects information about pass time and achievements, and also supports data caching for faster work. |
| 4 | + |
| 5 | +--- |
| 6 | + |
| 7 | +## 📋 Features |
| 8 | +- 🎮 Collect data about your Steam games |
| 9 | +- ⏱️ Pass time information from HowLongToBeat |
| 10 | +- 📊 Export data to Google Sheets |
| 11 | +- 💾 Caching data to speed up repeated requests |
| 12 | +- 🔄 Automatically update information |
| 13 | +- 📝 Logging of all actions for diagnostics |
| 14 | + |
| 15 | +--- |
| 16 | + |
| 17 | +## 🚀 Installation |
| 18 | + |
| 19 | +### 1. Install Python |
| 20 | +Make sure you have Python version 3.7 or higher installed. You can download it [here](https://www.python.org/downloads/). |
| 21 | + |
| 22 | +### 2. Download the project |
| 23 | +Download the latest version of the script or clone the repository: |
| 24 | +```bash |
| 25 | +git clone https://github.com/PilMek/SGL.git |
| 26 | +cd SGL |
| 27 | +``` |
| 28 | + |
| 29 | +### 3. Install dependencies |
| 30 | +The script will automatically install the required libraries at the first run. If you want to do it manually, execute: |
| 31 | +```bash |
| 32 | +pip install -r requirements.txt |
| 33 | +``` |
| 34 | + |
| 35 | +--- |
| 36 | + |
| 37 | +## ⚙️ |
| 38 | + |
| 39 | +### Steam API Setup |
| 40 | +1. **Get API key**: |
| 41 | + Go to [Steam Web API](https://steamcommunity.com/dev/apikey) and create an API key. |
| 42 | +2. **Find your SteamID64**: |
| 43 | + Use the [Steam ID Finder](https://steamidfinder.com/) to determine your profile ID. |
| 44 | +3. **Refresh the settings in `SGL.py`**: |
| 45 | +```python |
| 46 | +api_key = "INSERT_API_KEY" # API key Steam |
| 47 | +steam_id = "INSERT_STEAMID64" # Steam profile Id |
| 48 | +``` |
| 49 | + |
| 50 | +### Customizing Google Sheets |
| 51 | +1. **Create a project in Google Cloud Console**: |
| 52 | + - Go to [Google Cloud Console](https://console.cloud.google.com/). |
| 53 | + - Enable the API for Google Sheets. |
| 54 | +2. **Create a service account**: |
| 55 | + - Create a service account and download the JSON key. |
| 56 | + - Rename the key to `Google_Credentials.json` and move it to the script folder. |
| 57 | +3. **Create a Google table**: |
| 58 | + - Create the table and grant the service account access with editor privileges. |
| 59 | + - Copy the table ID from the URL and update it in `SGL.py`: |
| 60 | +```python |
| 61 | +spreadsheet_id = 'INSERT_SPREADSHEET_ID' # Google Sheet Id |
| 62 | +range_name = 'INSERT_NAME_LIST' # Name list of Google Sheet |
| 63 | +``` |
| 64 | + |
| 65 | +--- |
| 66 | + |
| 67 | +## 🎮 Usage |
| 68 | + |
| 69 | +### 1. Running the script |
| 70 | +Once configured, simply run the script with a double click or through the console: |
| 71 | +```bash |
| 72 | +python SGL.py |
| 73 | +``` |
| 74 | + |
| 75 | +The script will perform the following actions: |
| 76 | +- Check/install missing libraries. |
| 77 | +- Gather information about your Steam games. |
| 78 | +- Update the data in Google Sheets. |
| 79 | +- Save the cache to optimize future requests. |
| 80 | + |
| 81 | +### 2. Result |
| 82 | +- Your Google Sheets table will contain the following information: |
| 83 | + - App ID |
| 84 | + - Name of the game (with a link to Steam) |
| 85 | + - Game Time (hours) |
| 86 | + - Achievement Progress (%) - If the table says N/A, then the game has no achievements |
| 87 | + - Completion time (main story, all styles, completion) |
| 88 | + |
| 89 | +Example of a completed table: |
| 90 | + |
| 91 | +| App ID | Title | Playing time (hours) | Achievements (%) | Main Story | All Styles | Completionist | |
| 92 | +|--------|-----------------|----------------------|------------------|------------|------------|---------------| |
| 93 | +| 440 | Team Fortress 2 | 120.5 | 50% | 10 | 20 | 25 | |
| 94 | +| 570 | Dota 2 | 300.0 | 0% | N/A | N/A | N/A | |
| 95 | + |
| 96 | +--- |
| 97 | + |
| 98 | +## 📝 Logging |
| 99 | +- All actions are recorded in the `SGL_Logs.log` file. |
| 100 | +- If errors occur, examine this file for diagnosis. |
| 101 | + |
| 102 | +## 💾 Caching |
| 103 | +- The cache is stored in the `SGL_Cache.json` file and contains data about previously processed games. |
| 104 | +- If you need to update the data, simply delete the cache file before running the script. |
| 105 | + |
| 106 | +--- |
| 107 | + |
| 108 | +## ❗ Possible problems |
| 109 | + |
| 110 | +### Google Sheets authorization errors |
| 111 | +- Check that the `Google_Credentials.json` file is in the script folder. |
| 112 | +- Verify that the service account has access to the table. |
| 113 | + |
| 114 | +### Steam API errors |
| 115 | +- Verify that the API key you entered is correct. |
| 116 | +- Make sure your Steam profile is public. |
| 117 | + |
| 118 | +### Slow performance |
| 119 | +- The script pauses between requests to comply with API limits. This is normal. |
| 120 | +- Use the cache to speed up reruns. |
0 commit comments