Release script.module.thesportsdb - A python module for thesportsdb - Printable Version +- Kodi Community Forum (https://forum.kodi.tv) +-- Forum: Development (https://forum.kodi.tv/forumdisplay.php?fid=32) +--- Forum: Add-ons (https://forum.kodi.tv/forumdisplay.php?fid=26) +--- Thread: Release script.module.thesportsdb - A python module for thesportsdb (/showthread.php?tid=258129) |
script.module.thesportsdb - A python module for thesportsdb - enen92 - 2016-01-28 script.module.thesportsdb A python module packaged as a Kodi script module to wrap all thesportsdb API calls and for you to use on your own addon. An API key is required, please visit thesportsdb for more information. It has been re-written from scratch and provides an easy and intuitive way of accessing the data presented in the website. For issues or suggestions regarding the website please post on the thesportsdb.com forum thread here on the forum.. Donations for the website are also appreciated contact Zag if interested. Usage Addon.xml The module most be imported in the addon.xml of your addon and pointing to the correct version of the module PHP Code: <import addon="script.module.thesportsdb" version="1.0.0"/> Pythonic usage The module follows the API structure described Here. Every group method (Search,Lookups,Schedules,Livescores) is a Python class and all the endpoints (eg: lookupleague) is part of a class method. The module maps the json data to objects as much as possible, so each call returns one or more Team objects, League objects, Player objects, Livescores objects, Table objects, etc. I have made an extra effort to document the module properly, all the methods and objects available can be consulted here . Download, Source Code & Licence The module will be submitted to the official repository soon. Current Version: 1.0.0 Source code: https://github.com/enen92/script.module.thesportsdb Licence: GPL V2 A simple example... PHP Code: import thesportsdb A full Kodi addon that uses the script.module.thesportsdb: Below is the code for an addon that uses the module. Its goal is to obtain all the teams in the British Premier League, list the teams as directory items (with artwork and information) and link to the youtube channel of each team. All possible with only a few lines of python code. addon.xml PHP Code: <?xml version="1.0" encoding="UTF-8" standalone="yes"?> addon.py PHP Code: #!/usr/bin/env python A few screenshots of the resulting plugin... I plan to develop a few scripts using the module now that it is really simple to maintain and to use. Good luck making your own creations Use the thread to report errors or bugs, suggestions or questions regarding its usage. Regards RE: script.module.thesportsdb - A python module for thesportsdb - i96751414 - 2016-01-28 Really nice work RE: script.module.thesportsdb - A python module for thesportsdb - zag - 2016-01-29 Can't wait to see what people come up with... Awesome work!! RE: script.module.thesportsdb - A python module for thesportsdb - enen92 - 2016-01-29 First addon that uses this module has been released: http://forum.kodi.tv/showthread.php?tid=258252 A few more being worked on RE: script.module.thesportsdb - A python module for thesportsdb - zag - 2016-01-30 Awesome thanks. Few random ideas... Sports Events - Browse each sport, league, season and check for file local file according to the strFilename property on TSDB example: http://www.thesportsdb.com/event/447376 Team stats - Show a team from TSDB last 5 matches. Could be nice for betting research Next match - Popup when loading Kodi for your teams next match date and time RE: script.module.thesportsdb - A python module for thesportsdb - enen92 - 2016-01-30 (2016-01-30, 15:02)zag Wrote: Awesome thanks. My next one is also for livescores but a bit different. Something you can map to a keyboard/remote key to bring a livescores dialog on top of the game you're watching. Match events and lineups available like was planned for sportscenter. But those are nice ideas and pretty easy to implement RE: script.module.thesportsdb - A python module for thesportsdb - el_Paraguayo - 2016-01-31 Nice work! RE: script.module.thesportsdb - A python module for thesportsdb - zag - 2016-02-04 Another idea.. Something like this page in Kodi. Should be pretty easy with the nextmatch api call. http://www.thesportsdb.com/nextevents RE: script.module.thesportsdb - A python module for thesportsdb - enen92 - 2016-02-14 New addon up -> http://forum.kodi.tv/showthread.php?tid=259894 RE: script.module.thesportsdb - A python module for thesportsdb - enen92 - 2016-02-20 Just FYI the module should now be in the official repository. Lowest version supported is Isengard The screensaver is also on the repository now. RE: script.module.thesportsdb - A python module for thesportsdb - zag - 2016-02-20 Nice one, congrats! RE: script.module.thesportsdb - A python module for thesportsdb - raspberry_pd - 2017-03-10 Thanks for this work. I'm confused though. Why don't we, AFAIK, have a Kodi "Sport" content type, using TSDB API for metadata, yet? |