Giter Club home page Giter Club logo

myttpy's Introduction

MyTTPy

This repository tries to be sort of an unofficial API for mytischtennis.de by parsing the website contents

Example Usage

>>> from MyTTPy import MyTTClient
>>> client = MyTTClient()
>>> client.log_in("username", "password")
True
>>> player = client.get_player("Timo", "Boll", "Düsseldorf")
>>> player
Player(name='Timo Boll', id='17741', qttr=2595, club_name='Borussia Düsseldorf', club_id='141046')

MyTTClient

The MyTTClient defines several functions which can be used to extract information about a player, a club, a league (Not yet implemented) etc.

MyTTClient.log_in(username: str, password: str) -> bool
    Tries to log in with the given credentials and returns whether or not the login process succeeded. If login succeeds, the cookies are stored in an external file and automatically checked for validity when the MyTTClient constructor is being called.
MyTTClient.get_players(first_name: str, last_name: str) -> list[Player]
    Returns all the players with a matching (or similar) name.
MyTTClient.get_player(first_name: str, last_name: str, club_name: str) -> Player
    Looks up a player by their name and checks if the provided club name is contained in any of the clubnames of the player list.

TODO

  • Asynchronous requests with HTTPX
  • Club support
  • League support
  • TTR History
  • Ranking support
  • Add docstrings
  • Add documentation generator (Sphinx)

Disclaimer

I take no responsibility for misuse of this code and consequenses arising from such conduct. This is purely for educational purposes. Any possible account ban does not fall into my responsibility.

myttpy's People

Contributors

cxmu03 avatar

Watchers

 avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.