dathost api的python包装器
dathostpython的Python项目详细描述
这是dathost api的python包装器。
安装
pip3installdathostpython
基本用法
fromdathostpython.wrapperimportdathostdathost=dathost("email","password")# List servers and all their detailsprint(dathost.servers())# Start a serverdathost.start("server id")# Stop a serverdathost.stop("server id")# Duplicate a serverdathost.duplicate("server id")# Duplicate a server and print its idprint(dathost.duplicate("server id")["id"])# Delete a serverdathost.delete("server id")# Retrieve a file from the serverdathost.getFile("server id","path/to/file.txt")# Retrieve info on a serverprint(dathost.info("server id"))# Edit a server value# Multiple values can be passed, for example:# dathost.edit("570e1dadcde5f5xxxxxxxxxx", csgo_settings__rcon = "Bob", name = "Bob")## Note:# For parameters with "." in them, replace the "." with "__".# A full list of parameters can be found at https://dathost.net/api#!/default/put_game_server_itemdathost.edit("server id",parameter="value")# List files in a directory# The final 2 parameters (Hide default files and show file sizes) are optionaldathost.files("server id","path/to/dir/",True,True)# Sync the files between the local cache and the gameserverdathost.sync("server id")