2016-05-18 15:40:21 -04:00
|
|
|
# TeamspeakStats [![Build Status](https://travis-ci.org/Thor77/TeamspeakStats.svg?branch=master)](https://travis-ci.org/Thor77/TeamspeakStats) [![Coverage Status](https://coveralls.io/repos/Thor77/TeamspeakStats/badge.svg?branch=master&service=github)](https://coveralls.io/github/Thor77/TeamspeakStats?branch=master) [![Code Health](https://landscape.io/github/Thor77/TeamspeakStats/master/landscape.svg?style=flat)](https://landscape.io/github/Thor77/TeamspeakStats/master) [![PyPI](https://img.shields.io/pypi/v/tsstats.svg)](https://pypi.python.org/pypi/tsstats) [![Documentation Status](https://readthedocs.org/projects/teamspeakstats/badge/?version=latest)](http://teamspeakstats.readthedocs.io/en/latest/?badge=latest)
|
2015-03-05 12:48:10 -05:00
|
|
|
A simple Teamspeak stat-generator - based on server-logs
|
2015-03-05 12:53:47 -05:00
|
|
|
|
2016-05-11 14:39:45 -04:00
|
|
|
![screenshot](screenshot.png)
|
|
|
|
|
2015-07-13 15:14:03 -04:00
|
|
|
# Installation
|
2016-05-11 14:40:23 -04:00
|
|
|
- Install the package via PyPi `pip install tsstats`
|
2015-07-13 15:14:03 -04:00
|
|
|
|
2015-03-13 16:03:42 -04:00
|
|
|
# Usage
|
2016-05-10 17:05:12 -04:00
|
|
|
- Create a config (see [Configuration](https://github.com/Thor77/TeamspeakStats#configuration))
|
2016-05-11 14:40:23 -04:00
|
|
|
- Run the script `tsstats [-h]`
|
2015-03-13 16:03:42 -04:00
|
|
|
|
2015-07-13 15:36:53 -04:00
|
|
|
# Tests
|
2016-05-10 17:05:12 -04:00
|
|
|
- Install testing-requirements `pip install -r testing_requirements.txt`
|
|
|
|
- Run `py.test tsstats/`
|
2015-07-13 15:36:53 -04:00
|
|
|
|
2015-08-26 14:00:48 -04:00
|
|
|
# CMD-Arguments
|
|
|
|
```
|
2016-06-08 12:12:57 -04:00
|
|
|
usage: tsstats [-h] [-c CONFIG] [--idmap IDMAP] [-l LOG] [-o OUTPUT] [-d]
|
2016-06-23 15:42:03 -04:00
|
|
|
[-nod]
|
2015-08-26 14:00:48 -04:00
|
|
|
|
|
|
|
A simple Teamspeak stats-generator - based on server-logs
|
|
|
|
|
|
|
|
optional arguments:
|
2016-06-08 12:12:57 -04:00
|
|
|
-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
|
2016-06-23 15:42:03 -04:00
|
|
|
-nod, --noonlinedc don't add connect until now to onlinetime
|
2016-08-10 17:10:23 -04:00
|
|
|
-t TEMPLATE, --template TEMPLATE
|
|
|
|
path to custom template
|
2015-08-26 14:00:48 -04:00
|
|
|
```
|
|
|
|
|
2015-03-05 12:53:47 -05:00
|
|
|
# Configuration
|
|
|
|
|
2016-05-10 17:05:12 -04:00
|
|
|
#### [General]
|
|
|
|
| Key | Description |
|
|
|
|
|-----|-------------|
|
|
|
|
| log | Path to TS3Server-logfile(s) (supports [globbing](https://docs.python.org/3/library/glob.html)) |
|
|
|
|
| output | Path to the location, where the generator will put the generated `.html`-file |
|
2016-06-08 12:12:57 -04:00
|
|
|
| idmap | Path to [IdentMap](http://teamspeakstats.readthedocs.io/en/latest/identmap.html) |
|
|
|
|
| debug | debug mode |
|
2016-06-25 14:45:46 -04:00
|
|
|
| onlinedc | Add timedelta from last-connect until now to onlinetime for connected clients |
|
2016-08-10 17:10:23 -04:00
|
|
|
| template | Path to a custom template file (relative from `tsstats/` or absolute) |
|
2015-05-18 13:43:37 -04:00
|
|
|
|
2015-03-05 12:53:47 -05:00
|
|
|
|
|
|
|
## Example
|
|
|
|
```
|
|
|
|
[General]
|
2016-05-10 17:05:12 -04:00
|
|
|
log = /usr/local/bin/teamspeak-server/logs/ts3server*_1.log
|
|
|
|
output = /var/www/html/stats.html
|
2015-05-12 15:38:34 -04:00
|
|
|
```
|
|
|
|
|
|
|
|
# ID-Mapping
|
|
|
|
`id_map.json`
|
|
|
|
You can map multiple ID's to one (for example, when an user creates a new identity)
|
|
|
|
## Example
|
|
|
|
```json
|
|
|
|
{
|
|
|
|
"1": "2",
|
|
|
|
"3": "2"
|
|
|
|
}
|
2015-03-05 12:53:47 -05:00
|
|
|
```
|
2015-05-12 15:38:34 -04:00
|
|
|
The online-time of `1` and `3` will be added to the online-time of `2`
|
2015-03-13 16:03:42 -04:00
|
|
|
|
|
|
|
# TODO
|
|
|
|
- Localization
|