Site
Home / Forum / Developers / New Python API

New Python API


Posted: 08 Mar 2020 04:23

moxzilla
Posts: 2
Joined: Mar 2020

Hey all,

I am new to this website, I have started working on a new python API. This new api will be pretty simple but powerful and will be able to integrate with React or JS apps. Here is quick snippet of how the functions will look like. I have only been working on this for a day. I will be adding more calls that will return more specific things like search all sports in category fighting and listing all different types of fighting.


from Search import Search

searchTeams = Search().searchTeams
teams = searchTeams("Arsenal"
print(teams)
#

Moving forward I will be keeping it this simple in terms of commands so you don't have to think about any of the actual api calls
I know this doesn't look like much but in 3 lines you get whole json object of all teams with "Arsenal" in it. I have plans to do some stuff with the data in python but can be easily converted to an npm package.


Peak into Search.py

Let me know what you guys think.

Posted: 08 Mar 2020 09:20

zag
Posts: 1,558
Joined: Oct 2016

Looks great! The simpler the better I would say.

Things that are important is an easy way to import private API keys and a simple syntax and obviously Python 3 now.

See the current one for ideas, although it is very outdated now and has a dependency on Kodi which is a shame.

https://github.com/enen92/script.module.thesportsdb

Posted: 08 Mar 2020 15:02

moxzilla
Posts: 2
Joined: Mar 2020

Yes, I currently have a config file where you can set that like something like this:

import config
config = config()
config.apiKey = '1'


Posted: 06 Apr 2020 09:30

zag
Posts: 1,558
Joined: Oct 2016

Did anything ever come of this? We really need an updated Python Module....


Who is Online?

In total there are 68 users online :: 3 registered, 0 hidden and 65 guests (based on users active over the past 5 minutes) Most users ever online was 424 on Fri Nov 10, 2017 9:02 pm

About Us

Discussion forum for TheSportsDB.com site and related topics

Rules

- Be Polite
- Respect other users
- Always post log files with issues
- Try to be helpful
- No Piracy discussion

Showing 0 to 4 (Total: 4)