A python wrapper for the Dathost API
Project description
This is a python wrapper for the dathost API.
Installation
pip3 install dathostpython
Basic usage
from dathostpython.wrapper import dathost
dathost = dathost("email", "password")
# List servers and all their details
print(dathost.servers())
# Start a server
dathost.start("server id")
# Stop a server
dathost.stop("server id")
# Duplicate a server
dathost.duplicate("server id")
# Duplicate a server and print its id
print(dathost.duplicate("server id")["id"])
# Delete a server
dathost.delete("server id")
# Retrieve a file from the server
dathost.getFile("server id", "path/to/file.txt")
# Retrieve info on a server
print(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_item
dathost.edit("server id", parameter = "value" )
# List files in a directory
# The final 2 parameters (Hide default files and show file sizes) are optional
dathost.files("server id", "path/to/dir/", True, True)
# Sync the files between the local cache and the gameserver
dathost.sync("server id")
Project details
Release history Release notifications | RSS feed
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
dathostpython-1.3.2.zip
(2.5 kB
view details)
File details
Details for the file dathostpython-1.3.2.zip.
File metadata
- Download URL: dathostpython-1.3.2.zip
- Upload date:
- Size: 2.5 kB
- Tags: Source
- Uploaded using Trusted Publishing? No
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
75013fe219ebeb9bde164e0ccc61a9a24f8c6701f7627e5e18827fc26e06e974
|
|
| MD5 |
58efcd93b1541b68ea8640fd06ebb01c
|
|
| BLAKE2b-256 |
4ed87f97b6bfefed2954dee0b55bc7c836d2f9b5f9ca5753790fcf89ad2c063b
|