Code Monkey home page Code Monkey logo

soccer-cli's Introduction

Soccer CLI

PyPI version Join the chat at https://gitter.im/architv/soccer-cli Run on Repl.it

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.

Build from source

$ git clone https://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 .soccer-cli.ini in your home folder (/home/username/.soccer-cli.ini) that contains only your API token, such that:

$ cat /home/username/.soccer-cli.ini
<YOUR_API_TOKEN>

Note:

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

To get colorized terminal output on Windows, make sure to install ansicon and colorama.

Usage

Get standings for a league

$ soccer --standings --league=PL # PL 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 # get scores for all the seven leagues over the past 10 days

Get the output in csv or json

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

Store the ouput in a file

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

Help

$ soccer --help

List of supported leagues and their league codes

  • World:
    • WC: World Cup (if running/active)
  • Europe:
    • CL: Champions League
    • EC: European Championships (if running/active)
  • Brazil:
    • BSA: Brazil Serie A
  • England:
    • PL: English Premier League
    • ELC: English Championship
  • France:
    • FL1: Ligue 1
  • Germany:
    • BL: Bundesliga
  • Italy:
    • SA: Serie A
  • Netherlands:
    • DED: Eredivisie
  • Portugal:
    • PPL: Primeira Liga
  • Spain:
    • LLIGA: La Liga

Team and team codes

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

Tests

To run testing suite from root of repo

$ python -m unittest discover tests

To run specific test file (in this case the tests in test_request_handler.py)

$ python -m unittest tests.test_request_handler

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.
  • Python 3 support.

Licence

Open sourced under MIT License

Support

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

soccer-cli's People

Contributors

ale46 avatar andyg7 avatar architv avatar carlosvargas avatar dependabot[bot] avatar faurehu avatar gitter-badger avatar juliosueiras avatar mchac1 avatar mosrod avatar narensrini avatar perigk avatar phanikiranthaticharla avatar rodrigoflores avatar saturn avatar sca-shota-sato avatar sfx2k avatar taranjeet avatar thomasmanalil avatar thurask avatar tiktuk avatar tonjo avatar ueg1990 avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

soccer-cli's Issues

League Standings shown are from previous season

The league standings for any league shown are of previous season.
It would be better if the standings shown would be of current season.
Or there should be an option to select the year of the standings.
standings

not really an issue.... code stuff

I was looking over the codebase and noticed a few things.
Your indents were tabs instead of spaces.
Indents are 8 spaces (two indents) instead of 4 spaces(one indent)
Several lines in main.py, and possibly others, are longer than 80 characters

I was actually thinking of submitting a PR for the 80 characters thing, but couldn't due to the other points I mentioned. I don't know if this is what you wanted, but I just wanted to mention it.

Move printing functionality into it's own module

Now that we are able to print the results out into multiple formats (Issue #36), we realized that we need to separate the functionality into it's own module to make things cleaner.

I was thinking about this and here are my thoughts.

Move all of the printing code into a module called writers.py that will look like:

def get_writer(output):
    if output == 'stdout':
         return Console()
    ...

class Console:
    def live_scores(...):    
    ...

class JSON:
    def live_scores(...):   
    ...

class CSV:
    def live_scores(...):   
    ...

then in main.py we can call the factory function:

import writers

def get_live_scores(writer):
    ...
    writer.live_scores(...)

def main(..., output):
    writer = writers.get_writer(output)
    ...
    if live:
         get_live_scores(writer)

What do you guys think?

Tests

Hi!
I was hoping to contribute to this project. It seems like there currently aren't any tests (unit tests specifically), so I was thinking that could be a good way to get involved? If so, are there any guidelines for what kind of testing suite you guys would want setup? I saw test.py in the tests directory and it imports unittest so I assume that's the testing tool to use, but wanted to see if there is anything else to keep in mind or know before I got started.
Thanks for any advice :)
Andrew

Accented characters do not work on Windows

Standings option doesn't have this working, somehow.
Example:

[py2] C:\Users\thurask\git\soccer-cli>soccer --standings --league=LLIGA
POS     CLUB                              PLAYED        GOAL DIFF     POINTS
1       RC Celta de Vigo                  2             4             6
1       SD Eibar                          2             4             6
3       Club Atl├®tico de Madrid          2             4             6
4       FC Barcelona                      2             2             6

[py2] C:\Users\thurask\git\soccer-cli>soccer --standings --league=BL
POS     CLUB                              PLAYED        GOAL DIFF     POINTS
1       Borussia Dortmund                 3             10            9
2       FC Bayern M├╝nchen                3             9             9
3       VfL Wolfsburg                     3             4             7
4       1. FC K├Âln                       3             3             7

However, running without the standings option:

[py2] C:\Users\thurask\git\soccer-cli>soccer
Fortuna Köln         2    vs    1 Magdeburg
...
Bourg-en-Bresse Péronnas 2    vs        1 Sochaux FC

[py2] C:\Users\thurask\git\soccer-cli>soccer --team=PAL

2015-08-30      Udinese Calcio       0    vs    1 US Cittá di Palermo
...

CSV/JSON output

Cool work! Is it possible to get the output in csv or json as well?

#Feature Request

hi
Would it be possible to add Scottish league's premier and championship i'd be ever so grateful
id be willing to contribute to the scottish league text sorry im not programmer.
regards

Getting 504 trying to register for an API key

$ curl -v http://api.football-data.org/register
*   Trying 176.28.9.96...
* Connected to api.football-data.org (176.28.9.96) port 80 (#0)
> GET /register HTTP/1.1
> Host: api.football-data.org
> User-Agent: curl/7.43.0
> Accept: */*
> 
< HTTP/1.1 504 Gateway Time-out
< Server: nginx/1.2.1
< Date: Sat, 17 Sep 2016 06:36:45 GMT
< Content-Type: text/html
< Content-Length: 182
< Connection: keep-alive
< 
<html>
<head><title>504 Gateway Time-out</title></head>
<body bgcolor="white">
<center><h1>504 Gateway Time-out</h1></center>
<hr><center>nginx/1.2.1</center>
</body>
</html>
* Connection #0 to host api.football-data.org left intact

__init__

Just a question pertaining to the use of the init python file. If its blank is it there just as a place holder?

Premier League Table Bug

Searching for the current Premier League table shows Leicester City 7 points clear at the top.

This cannot possibly b....

oh wait :/

Watch feature

Having a built in watch feature so you can run once with --live and just leave the program running would be nice. Running through bash watch removes all your nice formatting and colour.

Not returning any data

$>soccer --standings --league=EPL
No standings availble for EPL.

$>soccer --team=MUFC --players
No data for the team. Please check the team code.

$>soccer --team=JUVE --players
No data for the team. Please check the team code.

$>soccer --league=EPL --time=20
No data for the given league.

$>soccer --league=CL
No data for the given league.

$>soccer --standings --league=CL
No standings availble for CL.


Environment: Windows

Upcoming feature with league

First of all. Great project, I really like it.

I do not know whether this is an issue or a feature request. I did not manage to get the upcoming feature to work with a league and not just a specific team.

soccer --league=BL --time=7 --upcoming
No BL matches in the past week.

In the help it says "Displays upcoming games when used with --time command.", but a potential restriction to a specific team is not mentioned.

Best,
Florian

Adding new collaborators

Soccer CLI has come a long way from where it started. The current version has lot many more features than the one I originally created. I am grateful for all the love and the strong support shown by the open source community.

Lately, I have got busy working with other projects and college, which has resulted in me ignoring soccer-cli. I have realised that for soccer-cli to be continuously made better, I would need help from people in the community. Thus I am adding new collaborators to soccer-cli.

I am adding @Saturn and @ueg1990 as collaborators for their amazing contribution to Soccer CLI!

PS: @ueg1990 and @Saturn please let me know if you have any issues with this.

New Ideas/Features

I am still assuming this is not completely bug free and all and that there can still be improvements. But we also discuss any new ideas and features that we can add to the soccer-cli. :)

is that really necessary to put all the .py files under /usr/bin instead of /usr/lib/python2.7/site-packages/ ?

soccer-cli /usr/
soccer-cli /usr/bin/
soccer-cli /usr/bin/authtoken.py
soccer-cli /usr/bin/leagueids.py
soccer-cli /usr/bin/liveapi.py
soccer-cli /usr/bin/main.py
soccer-cli /usr/bin/soccer
soccer-cli /usr/bin/teamnames.py
soccer-cli /usr/lib/
soccer-cli /usr/lib/python2.7/
soccer-cli /usr/lib/python2.7/site-packages/
soccer-cli /usr/lib/python2.7/site-packages/soccer_cli-0.0.3.1-py2.7.egg-info/
soccer-cli /usr/lib/python2.7/site-packages/soccer_cli-0.0.3.1-py2.7.egg-info/PKG-INFO
soccer-cli /usr/lib/python2.7/site-packages/soccer_cli-0.0.3.1-py2.7.egg-info/SOURCES.txt
soccer-cli /usr/lib/python2.7/site-packages/soccer_cli-0.0.3.1-py2.7.egg-info/dependency_links.txt
soccer-cli /usr/lib/python2.7/site-packages/soccer_cli-0.0.3.1-py2.7.egg-info/entry_points.txt
soccer-cli /usr/lib/python2.7/site-packages/soccer_cli-0.0.3.1-py2.7.egg-info/requires.txt
soccer-cli /usr/lib/python2.7/site-packages/soccer_cli-0.0.3.1-py2.7.egg-info/top_level.txt

UEFA CL qualifying league position information

I notice there is a desire to colour code UEFA CL spots and potentially EL spot too. This is just some simple information mainly about the currently supported leagues and their CL spot allocations.

The CL places would be simple enough because they are awarded purely on league position. ( Apart from the holders of both competitions )

  • LLIGA: Liga BBVA (Spanish League) - 4 CL (3 Group Stage, 1 Play off)
  • BL: Bundesliga (German League) - 4 CL (3 Group Stage, 1 Play off)
  • EPL: English Premier League - 4 CL (3 Group Stage, 1 Play off)
  • SA: Serie A (Italian League) - 3 CL (2 Group Stage, 1 Play off)
  • PPL: Primeira Liga (Portuguese League) - 3 CL (2 Group Stage, 1 Play off)
  • FL: Ligue 1 (French League) - 3 CL (2 Group Stage, 1 3rd qualifying round)
  • DED: Eredivisie (Dutch League) - 2 CL (1 Group Stage, 1 3rd qualifying round)

Europa League places will be trickier since it involves domestic cup winners and not just league position. But for the above leagues : The first place outside of a CL places gets placed into the group stage of the EL. And then the next place is usually awarded a third round qualifying place. Although not in England for example where they have two domestic cups. And maybe France too.

No standings returned

Any one getting this issue?

I have installed soccer-cli on windows but not able to get desired results.

C:\PRIV_LOCATION\Learning\PythonScripts\football>soccer --league EPL --standings
No standings availble for EPL.

Similar results for all leagues.

However LIVE returns results:
C:\PRIV_LOCATION\Learning\PythonScripts\football>soccer --live
=================== UEFA Champions League ====================

Liverpool 2 vs 2 Sevilla FC FT

NK Maribor 1 vs 1 Spartak Moscow FT

Note that i have created a new environment variable in windows and made it a system variable:
Variable Name: SOCCER_CLI_API_TOKEN
Variable Value: MY_AUTH_CODE

Also I would like to apologize if this is not how to raise the issue. This is my first open source project that i have actually installed in my computer.

Regards,
KB

Missing ECH definitions

ECH competition is not show in main.py and it's not configured in leagueproperties.py

soccer --league ECH --standings
POS    CLUB                              PLAYED        GOAL DIFF     POINTS
Traceback (most recent call last):
 File "/usr/local/bin/soccer", line 9, in <module>
    load_entry_point('soccer-cli==0.1.0.0', 'console_scripts', 'soccer')()
  File "/usr/local/lib/python2.7/dist-packages/click/core.py", line 722, in __call__
     return self.main(*args, **kwargs)
  File "/usr/local/lib/python2.7/dist-packages/click/core.py", line 697, in main
     rv = self.invoke(ctx)
  File "/usr/local/lib/python2.7/dist-packages/click/core.py", line 895, in invoke
     return ctx.invoke(self.callback, **ctx.params)
  File "/usr/local/lib/python2.7/dist-packages/click/core.py", line 535, in invoke
     return callback(*args, **kwargs)
  File "/usr/local/lib/python2.7/dist-packages/soccer_cli-0.1.0.0-py2.7.egg/soccer/main.py", line 296, in main
    get_standings(league, writer)
  File "/usr/local/lib/python2.7/dist-packages/soccer_cli-0.1.0.0-py2.7.egg/soccer/main.py", line 138, in get_standings
     writer.standings(req.json(), league)
   File "/usr/local/lib/python2.7/dist-packages/soccer_cli-0.1.0.0-py2.7.egg/soccer/writers.py", line 132, in standings
    cl_upper, cl_lower = LEAGUE_PROPERTIES[league]['cl']
KeyError: 'ECH'

fail

afther doing all i got this fail:

carlostkd@adsb-server:> soccer --standings --league=EPL
No standings availble for EPL.
carlostkd@adsb-server:
>

carlostkd@adsb-server:> soocer --team=MUFC
If 'soocer' is not a typo you can use command-not-found to lookup the package that contains it, like this:
cnf soocer
carlostkd@adsb-server:
>

carlostkd@adsb-server:> soccer --standings --league=PPL
No standings availble for PPL.
carlostkd@adsb-server:
>

what is wrong???

Use environment variable to store API token

Currently, authtoken.API_TOKEN is being used as the API key, instead, a environment variable can be used. The environment variable can be read with the help of os.environ.get() method.

Remove shebang from main.py?

Hello,

I wanted to know if the line in main.py is needed:

!/usr/bin/env python

Since its a command line project, i do not think you even need the shebang there.

Team name contains named HTML entity instead of unicode representation

I am guessing it is because this team was just promoted last season. But for some reason the team name from the API is given as Uni&atilde;o Madeira instead of Uni\u00e3o Madeira or equivalent.

It doesn't print very nicely 😄

Uni&atilde;o Madeira    0    vs   0     Vitoria Guimaraes   

It could be fixed with something like:

>>> from HTMLParser import HTMLParser
>>> h = HTMLParser()
>>> team = 'Uni&atilde;o Madeira'
>>> print team
Uni&atilde;o Madeira
>>> print h.unescape(team)
União Madeira

But don't think that is necessary since it is the only team name that contains a named HTML entity so I assume it is an error.

I have emailed the site owner about this issue.

ImportError: No module named config

Using OSX El Capitan here.
After being successfully installed, each command I want to apply shows up this error:

~> soccer --help
Traceback (most recent call last):
  File "/usr/local/bin/soccer", line 7, in <module>
    from soccer.main import main
  File "/usr/local/lib/python2.7/site-packages/soccer/main.py", line 21, in <module>
    from config import config
ImportError: No module named config`

Thanks!

AttributeError: 'Response' object has no attribute 'status_codes'

$ soccer --league=EPL --standings
Traceback (most recent call last):
  File "/usr/local/bin/soccer", line 9, in <module>
    load_entry_point('soccer-cli==0.1.0.0', 'console_scripts', 'soccer')()
  File "/Library/Python/2.7/site-packages/click-6.6-py2.7.egg/click/core.py", line 716, in __call__
    return self.main(*args, **kwargs)
  File "/Library/Python/2.7/site-packages/click-6.6-py2.7.egg/click/core.py", line 696, in main
    rv = self.invoke(ctx)
  File "/Library/Python/2.7/site-packages/click-6.6-py2.7.egg/click/core.py", line 889, in invoke
    return ctx.invoke(self.callback, **ctx.params)
  File "/Library/Python/2.7/site-packages/click-6.6-py2.7.egg/click/core.py", line 534, in invoke
    return callback(*args, **kwargs)
  File "/Library/Python/2.7/site-packages/soccer_cli-0.1.0.0-py2.7.egg/soccer/main.py", line 296, in main
    get_standings(league, writer)
  File "/Library/Python/2.7/site-packages/soccer_cli-0.1.0.0-py2.7.egg/soccer/main.py", line 137, in get_standings
    id=league_id))
  File "/Library/Python/2.7/site-packages/soccer_cli-0.1.0.0-py2.7.egg/soccer/main.py", line 93, in _get
    if req.status_codes == requests.codes.too_many_requests:
AttributeError: 'Response' object has no attribute 'status_codes'

Updates

Can we add North and South American leagues? I think we can also add EA Sports FIFA events. The FIWC is coming up

Invalid Header Value

$ soccer --standings --league=PL
Traceback (most recent call last):
File "/usr/local/bin/soccer", line 11, in
load_entry_point('soccer-cli==0.1.0.0', 'console_scripts', 'soccer')()
File "/home/alex/.local/lib/python2.7/site-packages/click/core.py", line 722, in call
return self.main(*args, kwargs)
File "/home/alex/.local/lib/python2.7/site-packages/click/core.py", line 697, in main
rv = self.invoke(ctx)
File "/home/alex/.local/lib/python2.7/site-packages/click/core.py", line 895, in invoke
return ctx.invoke(self.callback, ctx.params)
File "/home/alex/.local/lib/python2.7/site-packages/click/core.py", line 535, in invoke
return callback(*args, kwargs)
File "/usr/local/lib/python2.7/dist-packages/soccer_cli-0.1.0.0-py2.7.egg/soccer/main.py", line 178, in main
rh.get_standings(league)
File "/usr/local/lib/python2.7/dist-packages/soccer_cli-0.1.0.0-py2.7.egg/soccer/request_handler.py", line 74, in get_standings
id=league_id))
File "/usr/local/lib/python2.7/dist-packages/soccer_cli-0.1.0.0-py2.7.egg/soccer/request_handler.py", line 19, in _get
req = requests.get(RequestHandler.BASE_URL+url, headers=self.headers)
File "/home/alex/.local/lib/python2.7/site-packages/requests/api.py", line 69, in get
return request('get', url, params=params, kwargs)
File "/home/alex/.local/lib/python2.7/site-packages/requests/api.py", line 50, in request
response = session.request(method=method, url=url, kwargs)
File "/home/alex/.local/lib/python2.7/site-packages/requests/sessions.py", line 465, in request
resp = self.send(prep, send_kwargs)
File "/home/alex/.local/lib/python2.7/site-packages/requests/sessions.py", line 573, in send
r = adapter.send(request, kwargs)
File "/home/alex/.local/lib/python2.7/site-packages/requests/adapters.py", line 370, in send
timeout=timeout
File "/home/alex/.local/lib/python2.7/site-packages/requests/packages/urllib3/connectionpool.py", line 544, in urlopen
body=body, headers=headers)
File "/home/alex/.local/lib/python2.7/site-packages/requests/packages/urllib3/connectionpool.py", line 349, in _make_request
conn.request(method, url, httplib_request_kw)
File "/usr/lib/python2.7/httplib.py", line 1042, in request
self._send_request(method, url, body, headers)
File "/usr/lib/python2.7/httplib.py", line 1081, in _send_request
self.putheader(hdr, value)
File "/usr/lib/python2.7/httplib.py", line 1020, in putheader
raise ValueError('Invalid header value %r' % (one_value,))
ValueError: Invalid header value '
*******************\n'

FYI - I have changed the value of the API key to *. However, there is a \n at the end which I cannot get rid of.

$ pwd
/home/alex

$ cat .soccer-cli.ini


Again, changed the API key to *** - there is no \n in this file. Am I doing something wrong?

Thanks,

MLS Support

How about adding support for MLS? Also, if this gets approved I could start working on it.

No module named main

After successfully installing soccer-cli, this is the traceback error I'm getting when trying to use it

Traceback (most recent call last):
  File "C:\x\x\Anaconda\lib\runpy.py", line 162, in _run_module_as_main
    "__main__", fname, loader, pkg_name)
  File "C:\x\x\Anaconda\lib\runpy.py", line 72, in _run_code
    exec code in run_globals
  File "C:\x\x\Anaconda\Scripts\soccer.exe\__main__.py", line 5, in <module>
ImportError: No module named main

Thanks !

term soccer not recognised. [Windows-cmd]

@architv @rodrigoflores @Ale46
I'm new to this.
I installed everything. and set the env variable as mentioned.
opened windows PS and in the master directory typed this cmd:
$ soccer --standings --league=EPL

and got the following error. Can someone help?

soccer : The term 'soccer' is not recognized as the name of a cmdlet, function, script file, or operable program.
Check the spelling of the name, or if a path was included, verify that the path is correct and try again.
At line:1 char:1

  • soccer --standings --league=EPL
  • - CategoryInfo          : ObjectNotFound: (soccer:String) [], CommandNotFoundException
    - FullyQualifiedErrorId : CommandNotFoundException
    

Real Betis code in teams.json

Hi! I am trying to get the live scores for Real Betis Team but it has "null" code! :(
Could you please update the teams.json?

Thanks!

Got rankings last year

$ soccer --league EPL --standings
POS     CLUB                              PLAYED        GOAL DIFF     POINTS    
1       Leicester City FC                 38            32            81        
2       Arsenal FC                        38            29            71        
3       Tottenham Hotspur FC              38            34            70        
4       Manchester City FC                38            30            66        
5       Manchester United FC              38            14            66        
6       Southampton FC                    38            18            63        
7       West Ham United FC                38            14            62        
8       Liverpool FC                      38            13            60        
9       Stoke City FC                     38           -14            51        
10      Chelsea FC                        38            6             50        
11      Everton FC                        38            4             47        
12      Swansea City FC                   38           -10            47        
13      Watford FC                        38           -10            45        
14      West Bromwich Albion FC           38           -14            43        
15      Crystal Palace FC                 38           -12            42        
16      AFC Bournemouth                   38           -22            42        
17      Sunderland AFC                    38           -14            39        
18      Newcastle United FC               38           -21            37        
19      Norwich City FC                   38           -28            34        
20      Aston Villa FC                    38           -49            17

ImportError: No module named 'leagueids'

Hello, after building from git, I get:

Traceback (most recent call last):
File "/usr/bin/soccer", line 9, in
load_entry_point('soccer-cli==0.0.5.0', 'console_scripts', 'soccer')()
File "/usr/lib/python3.5/site-packages/pkg_resources/init.py", line 565, in load_entry_point
return get_distribution(dist).load_entry_point(group, name)
File "/usr/lib/python3.5/site-packages/pkg_resources/init.py", line 2697, in load_entry_point
return ep.load()
File "/usr/lib/python3.5/site-packages/pkg_resources/init.py", line 2370, in load
return self.resolve()
File "/usr/lib/python3.5/site-packages/pkg_resources/init.py", line 2376, in resolve
module = import(self.module_name, fromlist=['name'], level=0)
File "/usr/lib/python3.5/site-packages/soccer_cli-0.0.5.0-py3.5.egg/soccer/main.py", line 6, in
ImportError: No module named 'leagueids'

Maybe its a problem with Python Version. I have also Python 2.7 installed, how can I force the setup.py to use this?

Look up a team code

When trying to specify a specif team, the help flag just prints out a list of team code

--team [MCFC|BM|SWA|TSG|GUI|CRY|NAN|VFB|ACM|TOU|LOR|EIB|REN|EMP|Watfordfc|WBA|null|PAL|SEV|AFCB|ETI|JUVE|BMG|LFC|FCA|EFFZEH|SMC|GCF|SCB|WHU|FCB|M05|HSV|DAR|SUN|FCI|OSC|WOB|SGE|BOR|BSC|ATM|NUFC|VCF|ESP|CFC|THFC|FCG|S04|BIL|AFC|VIG|B04|H96|OLY|FCT|EFC|FIO|LCFC|ROM|MAR|SASS|SVW|Int|NIC|AVFC|PSG|LAC|NCFC|BVB|SFC|REI|MAD|MON|LAZ|MUFC|LUD|VALL|SCFC|VAL|MAL|SSC|RSS]

however there's no way for the user to figure out what code belongs to what team.

Perhaps what we can do is add a command to be able to search or look at what each code represents.

$ soccer --team-lookup AFC
Arsenal

or

$ soccer --team-lookup Arsenal
AFC

Soccer CLI argument team not working

I ran the following command:

soccer --team=CRY (which i am assuming is Crystal Palace)

but I get the following message:
'No action during past week. Change the time parameter to get more fixtures.'

Any specific reason this is happening? Crystal Palace played today in the morning

Also, what is the code for Chelsea?

# Feature request

It's really a great effort to bring the football scores, stats and others in command line interface. I'm happy with soccer-cli.

Following is just the enhancement that I feel in user perspective.

  • As we are using abbreviated form for the team name, league name.It is plausible that the user may not have idea about the abbreviation. So, it would be better to trigger suggestion if the user goes partially wrong.

eg: If the user intend to see the status of European Premier League(EPL), and the command he has given is like "soccer --league=EFL", it would be good to give all possible suggestion.

main.py refactoring

Hey guys,
I'm currently looking into writing tests for the app. I've finding some of the code slightly tough to test; I was thinking of refactoring main.py to be a little more object oriented, which I think would make it easier to test. Does this sound like something that would make sense to you guys?
Thanks!
Andy :)

Do all commands return results correctly on Windows 7?

Below are the commands not return anything for me:
Issues:

c:\Learning\football\soccer-cli>soccer --time=10

c:\Learning\football\soccer-cli>

c:\Learning\football\soccer-cli>soccer --league=BL
No BL matches in the past week.

c:\Learning\football\soccer-cli>soccer --league=PL
No PL matches in the past week.

c:\Learning\football\soccer-cli>soccer --league=FL1
No FL1 matches in the past week.

c:\Learning\football\soccer-cli>

c:\Learning\football\soccer-cli>soccer --league=FL2
No FL2 matches in the past week.

c:\Learning\football\soccer-cli>soccer --league=ELC
No ELC matches in the past week.

c:\Learning\football\soccer-cli>

And so on

c:\Learning\football\soccer-cli>soccer --time 5 --upcoming

c:\Learning\football\soccer-cli>
c:\Learning\football\soccer-cli>soccer --time 15 --upcoming

c:\Learning\football\soccer-cli>

Note that all other commands are returning results on windows 7

README.md broken link

Hello! There is a broken link in the README.md file under Install section. Where it says:
An API key from football-data.org will be required and you can register for one here.
'here' link is broken.

Also, I need an API key. Is there any way to get it from windows without curl?

Thanks

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.