Skip to main content

Quick access to TShock REST API using python.

Project description

Quick access to TShock REST API using python.

Endpoints

Server

/status

/tokentest

/v2/token/create

/v2/server/broadcast

/v3/server/rawcmd

/v3/server/motd

/v2/server/off

/v3/server/reload

/v3/server/rules

/v2/server/status

User

/v2/users/create

/v2/users/destroy

/v2/users/read

/v2/users/list

/v2/users/update

/v2/users/activelist

World

/v3/world/bloodmoon

/v2/world/butcher

/world/meteor

/world/read

/v2/world/save

Ban

/v3/bans/create

/v3/bans/destroy

/v3/bans/read

/v3/bans/list

Player

/v2/players/kick

/v2/players/kill

/v2/players/list

/v2/players/mute

/v4/players/read

/v2/players/unmute

Example

import tshockapi  # Import the tshockapi module

server = tshockapi.Server(host="127.0.0.1", port=7878, token="1234567890")  # Create a server object
print(server.v3_server_rawcmd(cmd="/who"))  # Print the result of the /who command
# {'status': '200', 'response': ['There are currently no players online.']}

Installation

Windows

pip install tshockapi

Linux

pip3 install tshockapi

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

tshockapi-0.1.2.tar.gz (4.6 kB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

tshockapi-0.1.2-py3-none-any.whl (4.6 kB view details)

Uploaded Python 3

File details

Details for the file tshockapi-0.1.2.tar.gz.

File metadata

  • Download URL: tshockapi-0.1.2.tar.gz
  • Upload date:
  • Size: 4.6 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: poetry/1.2.0 CPython/3.10.1 Darwin/22.1.0

File hashes

Hashes for tshockapi-0.1.2.tar.gz
Algorithm Hash digest
SHA256 c74005b1626f1ca544118c876273130ddbc9a04e02d14a2df572271476ce65cd
MD5 52910d128408b38e94fd3796f6258b21
BLAKE2b-256 3c10e94a608bb714ea20ecaccabc43397318ec3d8b0ce7efe9092d2a5e59055b

See more details on using hashes here.

File details

Details for the file tshockapi-0.1.2-py3-none-any.whl.

File metadata

  • Download URL: tshockapi-0.1.2-py3-none-any.whl
  • Upload date:
  • Size: 4.6 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: poetry/1.2.0 CPython/3.10.1 Darwin/22.1.0

File hashes

Hashes for tshockapi-0.1.2-py3-none-any.whl
Algorithm Hash digest
SHA256 3c655c81e17513dd8f69b5fd36fbd8c79da766d607b78ee0792c5ed370877160
MD5 d05bfb756fe0ff881cc7fbeda57060df
BLAKE2b-256 c245a3d70eec4db544703aecb9e29347618fe88de996d8e2bc0c4902e9a5ba96

See more details on using hashes here.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Pingdom Monitoring Sentry Error logging StatusPage Status page