项目作者: calestini

项目描述 :
Python wrapper for SportMonks soccer API
高级语言: Python
项目地址: git://github.com/calestini/sportmonks_api.git
创建时间: 2018-03-21T04:45:37Z
项目社区:https://github.com/calestini/sportmonks_api

开源协议:MIT License

下载


Sportmonks API

Unnoficial Python API to retrieve soccer data from Sportmonks.
Disclaimer: I have no relationship with Sportmonks and this project is simply to aid those who work with their soccer API.

Using the module

In order to use the module a user token is needed. Bear in mind the results might differ based on the subscription plan. Results hereby shown are for the full subscription pagkage.

For more information on the details and scope of Sportmonks API, please refer to its official documentation.

Installation

  • Cloning Repo
    1. git clone https://github.com/calestini/sportmonks_api.git

Dependencies

Import module

  1. >>> import sportmonks_calls as sm

Example

Load features class

  1. >>> fixtures = sm.Fixtures(sportmonks_token)

Query all fixtures by specific date

  1. >>> fixture_date = '2017-10-10'
  2. >>> fixtures.by_date(fixture_date)
  3. >>> print (fixtures.request.results)
  4. [{'aggregate_id': None,
  5. 'attendance': None,
  6. 'coaches': {'localteam_coach_id': None, 'visitorteam_coach_id': None},
  7. 'commentaries': True,
  8. 'deleted': False,
  9. 'formations': {'localteam_formation': '4-4-2',
  10. 'visitorteam_formation': '4-2-3-1'},
  11. 'group_id': None,
  12. 'id': 236705,
  13. 'league_id': 720,
  14. 'localteam_id': 18701,
  15. 'pitch': None,
  16. 'referee_id': 3,
  17. 'round_id': 28849,
  18. 'scores': {'et_score': None,
  19. 'ft_score': '2-0',
  20. 'ht_score': '1-0',
  21. 'localteam_pen_score': None,
  22. 'localteam_score': 2,
  23. 'visitorteam_pen_score': None,
  24. 'visitorteam_score': 0},
  25. 'season_id': 898,
  26. 'stage_id': 1753,
  27. 'standings': {'localteam_position': 2, 'visitorteam_position': 1},
  28. 'time': {'added_time': None,
  29. 'extra_minute': None,
  30. 'injury_time': 3,
  31. 'minute': 90,
  32. 'second': None,
  33. 'starting_at': {'date': '2017-10-10',
  34. 'date_time': '2017-10-10 18:45:00',
  35. 'time': '18:45:00',
  36. 'timestamp': 1507661100,
  37. 'timezone': 'UTC'},
  38. 'status': 'FT'},
  39. 'venue_id': 8412,
  40. 'visitorteam_id': 18708,
  41. 'weather_report': None,
  42. 'winning_odds_calculated': True}]

Documentation

Every endpoint is a class, and below are the classes available:

Endpoint Class Methods Mapped Level (0-100)
Fixture
Pre_Match_Odds
Continents
Countries
Leagues
Seasons
Commentaries
Videos
Head2Head
TVStations
Standings
Teams
Topscorers
Venues
Rounds
In_Play_Odds
Players
Bookmakers
Team_Squads