Skip to content

⚽ Football scores for hackers. 💻 A command line interface for all the football scores.

License

Notifications You must be signed in to change notification settings

ugurtigli/soccer-cli

 
 

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Soccer CLI

Join the chat at https://gitter.im/architv/soccer-cli

PyPI version

Soccer for Hackers - a CLI for all the football scores.

Install

An API key from football-data.org will be required and you can register for one here.

Using pip

$ pip install soccer-cli

Set your API key in an environment variable SOCCER_CLI_API_TOKEN

For example:

export SOCCER_CLI_API_TOKEN="<YOUR_API_TOKEN>"

Build from source

$ git clone git@github.com:architv/soccer-cli.git
$ cd soccer-cli
$ python setup.py install

You can set the API key using an environment variable as shown above or create a file config.py in the soccer package directory (soccer/config.py) with the single line

config = {
    "SOCCER_CLI_API_TOKEN": "<YOUR_API_TOKEN>",
}

Note:

Currently supports Linux, Mac OS X, NetBSD and FreeBSD.

Usage

Get standings for a league

$ soccer --standings --league=EPL # EPL is the league code for English Premier League

Get scores for a particular team

$ soccer --team=MUFC # MUFC is the team code for Manchester United
$ soccer --team=PSG --time=10 # scores for all the Paris Saint-Germain games over the past 10 days

Get upcoming fixtures

$ soccer --time 5 --upcoming # get upcoming fixtures for next 5 days
$ soccer --time 5 --upcoming --use12hour # upcoming fixture for next 5 days with timings in 12 hour format

Get scores for live games

$ soccer --live

Get scores for a particular league

$ soccer --league=BL # BL is the league code for Bundesliga
$ soccer --league=FL --time=15 # get scores for all the French Ligue games over the past 15 days

Get information about players of a team

$ soccer --team=JUVE --players

Get scores for all seven leagues with a set time period

$ soccer --time=10 # scores for all the seven leagues over the past 10 days

Get the output in csv or json

$ soccer --league EPL --standings --csv # prints the output in csv format
$ soccer --league EPL --standings --json # prints the output in json format

Store the ouput in a file

$ soccer --league EPL --standings --csv -o 'standings.csv' # stores the ouput in scv format in `standings.csv`

Help

$ soccer --help

List of supported leagues and their league codes

  • BL: Bundesliga (German League)
  • FL: Ligue 1 (French League)
  • EPL: English Premier League
  • LLIGA: Liga BBVA (Spanish League)
  • SA: Serie A (Italian League)
  • PPL: Primeira Liga (Portuguese League)
  • DED: Eredivisie (Dutch League)
  • CL: Champions League

Team and team codes

For a full list of supported team and team codes see this.

Demo

Standings

standings

Live scores

Team scores

Output in json format

Todo

  • Enable cache
  • Add more test cases
  • Add fixtures for UEFA Champions League
  • Add league filter for live scores
  • Color coding for Europa league and differentiation between straight CL and CL playoff spots, and the same for EL spots
  • Add support for team line up
  • A built in watch feature so you can run once with --live and just leave the program running.

Licence

Open sourced under MIT License

Support

If you like my work, please support the project by donating.

About

⚽ Football scores for hackers. 💻 A command line interface for all the football scores.

Resources

License

Stars

Watchers

Forks

Packages

No packages published

Languages

  • Python 100.0%