<h1 align="center">
<strong>Py-SteamCMD-Subprocess-Wrapper</strong>
</h1>
<div align="center">
<img src="https://img.shields.io/badge/Python->=3.8-green" alt="Python Badge">
</div>
### Usage example
```python
from steamcmd_wrapper import get_steamcmd_client
client = get_steamcmd_client("//Steam")
client.set_install_dir("/steamcmd") # SteamCMD official docs recommend setting dir before login
client.login_as_anonymous() # or client.login(user, password) if you need to own the game
client.update_app("app_id")
client.update_workshop_mod("app_id", "mod_id")
```
### Dependencies
You need to be able to manually run SteamCMD on your OS.
For Debian-Based Distributions (Ubuntu, Mint, etc.) this should be enough:
```shell
apt-get install lib32gcc1 # Debian
```
for details visit official docs:
[SteamCMD docs Known Issues](https://developer.valvesoftware.com/wiki/SteamCMD#ERROR.21_Failed_to_install_app_.22xxxxxx.22_.28No_subscription.29)
### Purpose
Simple wrapper to make it easier to use SteamCMD with python.
The idea came when I tried to install 100+ mods to Arma 3. Those mods varied in size from 2 KB to +20 GB.
To automate this I tried using other automation libraries, but they didn't solve the problem as they were simply
invoking.
```bash
./steamcmd.sh +login {username} {password} {2fa} +workshop_download_item 107410 450814997 +quit
```
multiple times which could lead to timeouts due to 2FA rate limiting.
Which created need of persistent client.
## Notes
- Disabling 2FA only moves the problem further as without 2FA you get the code on your e-mail
which makes it even harder to automate
- Some games (Arma 3 included) and their server require logged user to own the original game, so we cannot login
as anonymous
- Custom script for SteamCMD looks good on paper however you have to keep in mind that SteamCMD is bad. It can randomly timeout
while downloading mods (especially if they are big in size). If SteamCMD fails in the middle of the script you would
need to manually amend the script or risk running it again unchanged, which would validate all apps/mods again risking
yet another timeout.
- Originally I used it to run it on Jenkins Pipeline to keep mods updates on my machine.
Raw data
{
"_id": null,
"home_page": null,
"name": "Py-SteamCMD-Subprocess-Wrapper",
"maintainer": null,
"docs_url": null,
"requires_python": ">=3.8",
"maintainer_email": null,
"keywords": "Steam, Steam Server, SteamCMD, Linux",
"author": null,
"author_email": "Wojciech Maziarz <wmaziarzw@gmail.com>",
"download_url": "https://files.pythonhosted.org/packages/d6/82/def409e7ff9663ee677060d7a6ccc547b93768ab08156dae1ef4c25e9f5b/py_steamcmd_subprocess_wrapper-0.1.0.tar.gz",
"platform": null,
"description": "<h1 align=\"center\">\n <strong>Py-SteamCMD-Subprocess-Wrapper</strong>\n</h1>\n\n<div align=\"center\">\n <img src=\"https://img.shields.io/badge/Python->=3.8-green\" alt=\"Python Badge\">\n</div>\n\n### Usage example\n\n```python\nfrom steamcmd_wrapper import get_steamcmd_client\n\nclient = get_steamcmd_client(\"//Steam\")\n\nclient.set_install_dir(\"/steamcmd\") # SteamCMD official docs recommend setting dir before login \nclient.login_as_anonymous() # or client.login(user, password) if you need to own the game\n\nclient.update_app(\"app_id\")\nclient.update_workshop_mod(\"app_id\", \"mod_id\")\n```\n\n### Dependencies\nYou need to be able to manually run SteamCMD on your OS.\n\nFor Debian-Based Distributions (Ubuntu, Mint, etc.) this should be enough:\n```shell\napt-get install lib32gcc1 # Debian\n```\nfor details visit official docs:\n[SteamCMD docs Known Issues](https://developer.valvesoftware.com/wiki/SteamCMD#ERROR.21_Failed_to_install_app_.22xxxxxx.22_.28No_subscription.29)\n\n### Purpose\nSimple wrapper to make it easier to use SteamCMD with python.\n\nThe idea came when I tried to install 100+ mods to Arma 3. Those mods varied in size from 2 KB to +20 GB.\nTo automate this I tried using other automation libraries, but they didn't solve the problem as they were simply\ninvoking.\n```bash\n./steamcmd.sh +login {username} {password} {2fa} +workshop_download_item 107410 450814997 +quit\n```\nmultiple times which could lead to timeouts due to 2FA rate limiting.\nWhich created need of persistent client.\n\n## Notes\n- Disabling 2FA only moves the problem further as without 2FA you get the code on your e-mail\nwhich makes it even harder to automate\n- Some games (Arma 3 included) and their server require logged user to own the original game, so we cannot login\nas anonymous\n- Custom script for SteamCMD looks good on paper however you have to keep in mind that SteamCMD is bad. It can randomly timeout\nwhile downloading mods (especially if they are big in size). If SteamCMD fails in the middle of the script you would\nneed to manually amend the script or risk running it again unchanged, which would validate all apps/mods again risking \nyet another timeout.\n- Originally I used it to run it on Jenkins Pipeline to keep mods updates on my machine.\n",
"bugtrack_url": null,
"license": null,
"summary": "SteamCMD Python wrapper to persist steam's login sessions",
"version": "0.1.0",
"project_urls": {
"Issues": "https://github.com/Wojtini/Interactive-SteamCMD-Wrapper/issues",
"Repository": "https://github.com/Wojtini/Interactive-SteamCMD-Wrapper"
},
"split_keywords": [
"steam",
" steam server",
" steamcmd",
" linux"
],
"urls": [
{
"comment_text": "",
"digests": {
"blake2b_256": "2eaddf1e7427b2897d6893f3a5441014fcb7737f3e1e7270a073c7bab4ae5850",
"md5": "164449ec6a7d634f3ee0d223f9d78a5d",
"sha256": "9775675e621f98a20d392a8e4017b1f4ea40ee167d4a76c3396de674bfabb25e"
},
"downloads": -1,
"filename": "Py_SteamCMD_Subprocess_Wrapper-0.1.0-py3-none-any.whl",
"has_sig": false,
"md5_digest": "164449ec6a7d634f3ee0d223f9d78a5d",
"packagetype": "bdist_wheel",
"python_version": "py3",
"requires_python": ">=3.8",
"size": 17065,
"upload_time": "2024-06-01T12:24:06",
"upload_time_iso_8601": "2024-06-01T12:24:06.496907Z",
"url": "https://files.pythonhosted.org/packages/2e/ad/df1e7427b2897d6893f3a5441014fcb7737f3e1e7270a073c7bab4ae5850/Py_SteamCMD_Subprocess_Wrapper-0.1.0-py3-none-any.whl",
"yanked": false,
"yanked_reason": null
},
{
"comment_text": "",
"digests": {
"blake2b_256": "d682def409e7ff9663ee677060d7a6ccc547b93768ab08156dae1ef4c25e9f5b",
"md5": "3cecba1585cd647b33425cb9c5730889",
"sha256": "288011289d03ea1d168599c25f2f9224d5ee043dc70d6cd0e2fb56f7ec37827b"
},
"downloads": -1,
"filename": "py_steamcmd_subprocess_wrapper-0.1.0.tar.gz",
"has_sig": false,
"md5_digest": "3cecba1585cd647b33425cb9c5730889",
"packagetype": "sdist",
"python_version": "source",
"requires_python": ">=3.8",
"size": 10382,
"upload_time": "2024-06-01T12:24:08",
"upload_time_iso_8601": "2024-06-01T12:24:08.743755Z",
"url": "https://files.pythonhosted.org/packages/d6/82/def409e7ff9663ee677060d7a6ccc547b93768ab08156dae1ef4c25e9f5b/py_steamcmd_subprocess_wrapper-0.1.0.tar.gz",
"yanked": false,
"yanked_reason": null
}
],
"upload_time": "2024-06-01 12:24:08",
"github": true,
"gitlab": false,
"bitbucket": false,
"codeberg": false,
"github_user": "Wojtini",
"github_project": "Interactive-SteamCMD-Wrapper",
"travis_ci": false,
"coveralls": false,
"github_actions": true,
"requirements": [
{
"name": "certifi",
"specs": [
[
"==",
"2024.2.2"
]
]
},
{
"name": "charset-normalizer",
"specs": [
[
"==",
"3.3.2"
]
]
},
{
"name": "idna",
"specs": [
[
"==",
"3.7"
]
]
},
{
"name": "requests",
"specs": [
[
"==",
"2.32.3"
]
]
},
{
"name": "urllib3",
"specs": [
[
"==",
"2.2.1"
]
]
}
],
"tox": true,
"lcname": "py-steamcmd-subprocess-wrapper"
}