pyETT
Python library for Eleven VR Table Tennis data.
Getting Started
pyETT: Python library for Eleven VR Table Tennis data.
[1]:
from pyETT import ett
import pandas as pd
Player and user search
In order to get player’s information we first need to uniquely identify a player. We can use the user_search()
method of an object of the class ETT
to search players by username, as follows:
[2]:
eleven = ett.ETT()
eleven.user_search_dataframe('Highlander').head()
[2]:
| | id | name | elo | rank | wins | losses | last_online |
| 0 | 248681 | Highlandersge | 1488.0 | 361225 | 0 | 1 | 2021-03-30T17:29:28.963Z |
| 1 | 246892 | mwwhighlander | 1500.0 | 222424 | 0 | 0 | 2021-01-02T23:00:36.762Z |
| 2 | 218318 | .::Highlander::. | 1500.0 | 179327 | 0 | 0 | 2021-01-07T00:52:31.209Z |
| 3 | 166876 | The Highlander | 1530.0 | 16962 | 4 | 1 | 2020-12-01T20:22:39.752Z |
| 4 | 384291 | highlander10 | 1500.0 | 71453 | 0 | 0 | 2021-04-16T22:18:26.874Z |
Here, the function returns all players that contain the input username string ‘Highlander’. To search for a perfect match, we can pass the argument perfect_match=True
:
[3]:
eleven.user_search_dataframe('highlanderNJ', perfect_match=True)
[3]:
| | id | name | elo | rank | wins | losses | last_online |
| 0 | 348353 | highlanderNJ | 2013.5 | 2042 | 475 | 372 | 2021-06-30T01:53:32.742Z |
In this search, we were able to find the player with username ‘highlanderNJ’ which turns out to be me. We can now instantiate a Player
object to obtain his information:
[4]:
print(p:=ett.Player(348353))
highlanderNJ
[5]:
print(f"username:{p.name}\n elo:{p.elo}\n rank:{p.rank}\n wins:{p.wins}\n losses:{p.losses}\n")
username:highlanderNJ
elo:2013.5
rank:2042
wins:475
losses:372
We can see I have an Elo number of 2013.5, which puts me ranked in number 2042 in the world with 475 ranked wins and 372 losses. That’s not entirely bad as the total number of users around 500,000 players!
Installation
From PyPI
$ pip install pyETT
Documentation
Documentation for pyETT is located at https://pyett.readthedocs.io/.