simeonjackman / FantasyPLHelper

Helper for fantasy pl transfers

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

FantasyPLHelper

A helper for the Premier League Fantasy Football game.

Installation

Default

Install dependencies in virtualenv:

pipenv install

Run virtualenv:

source env/bin/activate

Install dependencies in virtualenv:

pip3 install -r requirements.txt

Run server in virtualenv:

python3 main.py

Docker

Make sure you have the docker toolbox installed.

Start by building the container:

make build

Run the container:

make run

Check whether your container is running:

docker ps
> CONTAINER ID        IMAGE                      COMMAND             CREATED             STATUS              PORTS                    NAMES
> e67904e80b84        fantasy_pl_helper:latest   "python main.py"    1 second ago        Up 1 second         0.0.0.0:5000->5000/tcp   fantasy_docker

Test the application on localhost.

Stop the docker container:

make stop

Clean up tangling docker images and caches:

make clean

API Documentation

/players

Getter utility with basic filters for players.

?name={name}
?min_cost={cost}
?max_cost={cost}
?goals_scored={goals}
?assists={assists}
?sort_by={key}
?show={key1,key2,...}
ex: {host}/players?sort_by=assists&name=f&show=first_name,second_name,goals_scored&min_cost=80

/teams

Getter utility with basic filters for teams.

?name={name}
?id={id}

?strength={strength}
?max_strength={max_strength}
?min_strength={min_strength}

?strength_overall_home={strength_overall_home}
?max_strength_overall_home={max_strength_overall_home}
?min_strength_overall_home={min_strength_overall_home}

?strength_overall_away={strength_overall_away}
?max_strength_overall_away={max_strength_overall_away}
?min_strength_overall_away={min_strength_overall_away}

?strength_attack_home={strength_attack_home}
?max_strength_attack_home={max_strength_attack_home}
?min_strength_attack_home={min_strength_attack_home}

?strength_attack_away={strength_attack_away}
?max_strength_attack_away={max_strength_attack_away}
?min_strength_attack_away={min_strength_attack_away}

?strength_defence_home={strength_defence_home}
?max_strength_defence_home={max_strength_defence_home}
?min_strength_defence_home={min_strength_defence_home}

?strength_defence_away={strength_defence_away}
?max_strength_defence_away={max_strength_defence_away}
?min_strength_defence_away={min_strength_defence_away}

?show={key1,key2,...}
?sort_by={key}
ex: {host}/teams?name=team_name

/element-types

Getter utility with basic filters for element types.

?show={key1,key2,...}
ex:

/events

Getter utility with basic filters for events.

?id={id}
?from={id}
?until={id}
?is_previous={y/n}
?is_current{y/n}
?is_next={y/n}
?finished={y/n}
?data_checked={y/n}
?deadline_after={YYYY-MM-DDZHH:MM:SS}
?show={key1,key2,...}
ex: {host}/events?from=10&until=20&finished=false&show=name,id,deadline_time

/fixtures

Getter utility with basic filters for events.

?finished={y/n}
?kickoff_after={YYYY-MM-DDZHH:MM:SS}
?team_h={team_id}
?team_a={team_id}
?team={team_id}
?show={key1,key2,...}
ex: 

/top-player-picks

Getter utility with basic filters for the picks of the top players.

?rank={rank}
?show={key1,key2,...}
ex: {host}/top_player_picks?rank=1

/player-to-player/<player_id>

Getter utility to show players who work well alongside a query player X.

Can be used to make recommendations of the form:

The best users who picked player X also picked player Y.

?top={top}
ex: {host}/player-to-player/388?top=3

/player-summary/<player_id>

Getter utility for player summaries.

ex: {host}/player-summary/388

/scores/<score>

Calculate a score for each queried player.

Scorer Points

Calculates the sum of the number of assists and the number of goals scored for each player.

ex: {host}/player-score/scorer-points

About

Helper for fantasy pl transfers

License:MIT License


Languages

Language:Python 98.4%Language:Makefile 1.1%Language:Dockerfile 0.5%