Package: py-steamcmd-wrapper
Py-SteamCMD-WrapperDuring the setup of game servers it can be infuriating to use SteamCMD due to some particularities within the SteamCMD Toolkit. This simple wrapper for python will handle everything from installation to downloading games.Getting StartedThese instructions will get you a copy of the project up and running on your machine for development and testing purposesPrerequisitesWhen installing on linux, you'll need the 32-bit libraries specified on thevalvesoftwarewebsite.Ubuntusudo apt-get install lib32stdc++6If you get an error for missing dependencies or broken packages, run the followingdpkg --add-architecture i386
 apt-get update
 apt-get install lib32gcc1RHEL, Fedora, CentOS, etc.yum install glibc.i686 libstdc++.i686Arch LinuxEnable themultilib repositorypacman -S lib32-gcc-libsInstallingRun the following command to install the packagepipinstallpy-steamcmd-wrapperIn order to install steam using this wrapper you'll have to do the following:frompysteamcmdwrapperimportSteamCMDsteam=SteamCMD("MyInstallationDir")steam.install()UsageCurently there are 4 methods available in the wrapper. These are as follows:installloginapp_updateworkshop_updateYou can use these methods to install steamcmd, login a user, download a game/gameserver or a workshop mod.
If your game needs a valid subscription (AKA you've bought the game) the login function needs to be called. When left empty, it will prompt for login information.A small code snippet to install an Arma III dedicated server with CBA_A3 installedimportosfrompysteamcmdwrapperimportSteamCMD,SteamCMDExceptionSERVER_DIR="armaserver"WORKSHOP_DIR=os.path.join(os.getcwd(),"armamods","steamapps","workshop","content","107410")MOD_DIR=os.path.join(os.getcwd(),SERVER_DIR)s=SteamCMD("steamcmd")try:s.install()exceptSteamCMDException:print("Already installed, try to use the --force option to force installation")s.login()s.app_update(233780,os.path.join(os.getcwd(),SERVER_DIR),validate=True)modname="cba_a3"id="450814997"s.workshop_update(107410,id,os.path.join(os.getcwd(),"armamods/"),validate=True)try:os.symlink(os.path.join(WORKSHOP_DIR,id),os.path.join(MOD_DIR,"@"+modname))exceptFileExistsError:print("Already linked")keydir=os.path.join(MOD_DIR,"@"+modname,"keys")ifnotos.path.isdir(keydir):keydir=os.path.join(MOD_DIR,"@"+modname,"key")forkeyinos.listdir(keydir):print("Linking ",key)try:os.symlink(os.path.join(keydir,key),os.path.join(MOD_DIR,"keys",key))exceptFileExistsError:print("Already Linked")This snippet can be used with another project of mine. This will be coming soon!The login function is only needed when a subscription to the game is needed. The wrapper uses the 'Anonymous' user by defaultContributingPlease readCONTRIBUTING.mdfor details on our code of conduct, and the process for submitting pull requests to me.VersioningWe useSemVerfor versioning. For the versions available, see thetags on this repository.AuthorsWouter Mellema-Initial work-wmellemaSee also the list ofcontributorswho participated in this project.LicenseThis project is licensed under the MIT License - see theLICENSE.mdfile for detailsAcknowledgmentsf0rkz, whose originalpysteamcmdproject was abandoned, but still very usefull as a building block