fpl

command module
v0.0.0-...-e29a901 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Mar 19, 2024 License: Apache-2.0 Imports: 1 Imported by: 0

README

FPL


fpl

A Go CLI tool for Fantasy Premier League

Table of Contents

Introduction

Go Go Report Card

fpl is a CLI tool written in Go that pulls information from the Fantasy Premier League API and presents it in a readable format.


                ________    _______      ___
                |   ____|   |   _  \     |  |
                |  |__      |  |_)  |    |  |
                |   __|     |   ___/     |  |
                |  |        |  |         |  -----.
                |__|        |__|         |_______|

                A CLI tool for retrieving FPL data

Usage:
  fpl [command]

Available Commands:
  details     Returns details of manager for current season, e.g. league standings, cash in the bank, overall points etc
  fixtures    Get the fixtures for a specific gameweek
  help        Help about any command
  history     Returns history for a managers current and past seasons
  points      Get the points for a specified gameweek (defaults to latest active gameweek)
  rivals      Show the points for all of your rivals (specified in config) for a specified gameweek

Flags:
      --config string     config file (default is $HOME/.fpl.yaml)
  -g, --gameweek string   The gameweek you wish to see details for
  -h, --help              help for fpl
  -t, --toggle            Help message for toggle

Use "fpl [command] --help" for more information about a command.

Pre-requisites

Installation

Installing the tool is very straightforward:

git clone https://github.com/paddymorgan84/fpl.git
cd fpl
go install

Configuration

fpl accepts a config file called .fpl.yaml, by default it will search your home directory.

Configuring your team ID

Setting a default team ID prevents the need for you to provide it when you want to use fpl for your own team.

team-id: 1327470

You can get your FPL team id via the Gameweek History page, linked on your FPL squad page. Simply click that link and check the URL displayed in your browser. You should see something like this:

http://fantasy.premierleague.com/entry/xxxx/history/

Configuring your rivals

You can add your rivals team ID's to allow you to see their points for a specified gameweek

rivals:
  - 2619024
  - 1818664
  - 3108094

You can obtain their FPL team id via the same method specified above.

Dockerfile

If you have Docker installed, you can also run the tool using the Dockerfile provided:

docker build -t paddymorgan84/fpl .
docker run --rm -t -v "${HOME}/.fpl.yaml":/root/.fpl.yaml paddymorgan84/fpl

Acknowledgements

  • Shoutout to Frenzel Timothy for his how-to guide on using the Fantasy Premier League API 👏
  • I've used Cobra to help me create the scaffolding for a Go CLI tool. I would highly recommend it 👍

Documentation

Overview

Copyright © 2021 NAME HERE <EMAIL ADDRESS>

Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. You may obtain a copy of the License at

http://www.apache.org/licenses/LICENSE-2.0

Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions and limitations under the License.

Directories

Path Synopsis

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL