A simple Teamspeak stats-generator - based on server-logs https://claytonia.net/tsstats.html
Go to file
Matthew 5968dc31dd Support for a nicer structure for ID maps (#12)
This adds support for a more expressive (albeit more verbose) IdentMap
structure. It makes it easier to annotate the structure with additional
data (such as names to associate with the IDs), to assist with
maintaining the IdentMap.
2017-02-18 14:58:23 +01:00
docs Support for a nicer structure for ID maps (#12) 2017-02-18 14:58:23 +01:00
tsstats Support for a nicer structure for ID maps (#12) 2017-02-18 14:58:23 +01:00
.coveragerc remove test_general.py (testing __main__) to get clear coverage-results 2016-05-19 21:40:37 +02:00
.gitignore Add various python-related paths to .gitignore 2017-01-26 19:11:34 +01:00
.travis.yml Run tests for py3.5 on Travis 2017-02-15 21:55:38 +01:00
LICENSE Bump LICENSE-year to 2017 2017-02-11 22:15:51 +01:00
README.md Add supported python-versions 2017-02-15 21:55:11 +01:00
requirements.txt update {testing_,}requirement-versions 2016-05-08 18:00:17 +02:00
screenshot.png Update screenshot.png 2017-02-11 22:21:58 +01:00
setup.py Bump version to 1.1.2 2017-02-16 22:49:27 +01:00
testing_requirements.txt use py.test instead of nose for testing 2016-05-09 20:09:16 +02:00

README.md

TeamspeakStats Build Status Coverage Status Code Health PyPI Documentation Status

A simple Teamspeak stat-generator - based solely on server-logs

screenshot

Installation

  • Install the package via PyPi pip install tsstats
  • Clone this repo git clone https://github.com/Thor77/TeamspeakStats and install with python setup.py install
  • Just use the package as is via python -m tsstats [-h]

Usage

  • Run the script tsstats [-h]
  • Optionally create a config-file (see Configuration)
  • The package works entirely off your Teamspeak server's logs, so that no ServerQuery account is necessary

Example

tsstats -l /var/log/teamspeak3-server/ts3server*.log -o /var/www/tsstats.html

Parse logs matching ts3server*.log in /var/log/teamspeak3-server and write output to /var/www/tsstats.html.

CLI-Usage

usage: tsstats [-h] [-c CONFIG] [--idmap IDMAP] [-l LOG] [-o OUTPUT] [-d]
                   [-nod]

A simple Teamspeak stats-generator - based solely on server-logs

optional arguments:
  -h, --help            show this help message and exit
  -c CONFIG, --config CONFIG
                        path to config
  --idmap IDMAP         path to id_map
  -l LOG, --log LOG     path to your logfile(s)
  -o OUTPUT, --output OUTPUT
                        path to the output-file
  -d, --debug           debug mode
  -nod, --noonlinedc    don't add connect until now to onlinetime
  -t TEMPLATE, --template TEMPLATE
                        path to custom template
  -dtf DATETIMEFORMAT, --datetimeformat DATETIMEFORMAT
                        format of date/time-values (datetime.strftime)
  -otth ONLINETIMETHRESHOLD, --onlinetimethreshold ONLINETIMETHRESHOLD
                        threshold for displaying onlinetime (in seconds)

Configuration

[General]

Key Description
log Path to TS3Server-logfile(s) (supports globbing)
output Path to the location, where the generator will put the generated .html-file
idmap Path to IdentMap
debug debug mode
onlinedc Add timedelta from last-connect until now to onlinetime for connected clients
template Path to a custom template file (relative from tsstats/ or absolute)
datetimeformat Format of date/time-values used for render-timestamp and last online (using datetime.strftime)
onlinetimethreshold Clients with an onlinetime below that threshold (in seconds) are hidden in the onlinetime-section

Example

[General]
log = /usr/local/bin/teamspeak-server/logs/ts3server*_1.log
output = /var/www/html/stats.html

Contributing

Please make sure tests are succeeding and your code follows flake8-guidelines.

Run tests

  • Install testing-requirements pip install -r testing_requirements.txt
  • Run py.test tsstats/

Supported Python-versions

  • Python 2 (2.7)
  • Python 3 (3.5, 3.6)