Site
Home / Forum / 3rd Party Projects / [Library] Another PHP library

[Library] Another PHP library


Posted: 01 Jan 2021 22:15
nkl-kst
Posts: 16
Joined: 2021-01-01

Hi guys,

my name is Nick and I'm a IT professional from Berlin. I have plans to use your sport events data in a personal PHP project and therefore I tried to use the existing PHP library. Unfortunetely this seems to be unmaintained, so I decided to create a new library: https://github.com/nkl-kst/the-sports-db

It would be nice to get some feedback on this work, thanks in advance.

Also I would like to ask if there is the possibility to get an API key to implement the "Patreon only" features, thanks.

Cheers and a happy new year!
Nick

zag
Posted: 01 Jan 2021 23:19

zag
Posts: 3,327
Joined: 2020-03-23

Hi guys,

my name is Nick and I'm a IT professional from Berlin. I have plans to use your sport events data in a personal PHP project and therefore I tried to use the existing PHP library. Unfortunetely this seems to be unmaintained, so I decided to create a new library: https://github.com/nkl-kst/the-sports-db

It would be nice to get some feedback on this work, thanks in advance.

Also I would like to ask if there is the possibility to get an API key to implement the "Patreon only" features, thanks.

Cheers and a happy new year!
Nick


AWESOME!

Yes the old library is a little outdated now, great to see a new one.

Can you email thedatadb (at) gmail.com and I will send you a private patreon key for free

EDIT: On initial look at your code it looks very clean! Nice job.

nkl-kst
Posted: 19 Jan 2021 14:25
nkl-kst
Posts: 16
Joined: 2021-01-01

I saw that you updated the main menu link, thank you

In the last week I added most of the "Patreon only" features to the library. Still missing features are video highlights and livescores for v1 and v2. I will wait to work on them until they are requested, because for now I don't really need them.

You are welcome to open an issue on Github if you miss something. I will also have a look on this thread occasionally.

Cheers
Nick

Edit: Typo

zag
Posted: 19 Jan 2021 22:36

zag
Posts: 3,327
Joined: 2020-03-23

Thats great thanks.

I'd really like to see V2 livescores and video at some point as they are the main Patreon features I think people use.

Posted: 25 Jan 2021 09:06
nkl-kst
Posts: 16
Joined: 2021-01-01

The lib supports video highlights and livescores (v2) now

zag
Posted: 04 May 2021 05:49
nkl-kst
Posts: 16
Joined: 2021-01-01

Hi there,

I have some trouble with empty model attributes in the library: https://github.com/nkl-kst/the-sports-db/issues/16

As I mentioned in the issue, I would like to be as strict as possible for model attributes, but this seems to bee a bit tricky, because I cannot be 100% sure if there are values for all necessary properties for all entities.

@zag Are you able to help me out here? Are there some properties which are always present in specific models? Like referencing IDs, team and player names for example. Do you have something like a model specification I could use to be as strict as possible for model attributes.

Thanks in advance for your help.

zag
Posted: 04 May 2021 07:47

zag
Posts: 3,327
Joined: 2020-03-23

Morning,

I don't have any kind of documentation, but I'm happy to normalise the nulls of the database if you let me know where the issue is I'm aware it is bad in some places with empty strings instead of null, but due to the use of all kinds of different importers this can get historically messy. Just let me know where to improve.

Posted: 04 May 2021 07:49

zag
Posts: 3,327
Joined: 2020-03-23

Just looking at the GutHub issue it seems that 'strManager' and 'strAlternate' in the teams data are the issue.

Thats to be expected really as not all teams have alternative names or managers. Do you want empty ones to be NULL always?

Posted: 04 May 2021 09:40
nkl-kst
Posts: 16
Joined: 2021-01-01

Thanks for the quick response. Your are right, these two fields are empty in the JSON response, but not optional in the current team model (https://github.com/nkl-kst/the-sports-db/blob/master/src/Entity/Team.php#L13).

We could change these two model attributes to be nullable in the team class, but how can we know if there are no other attributes, which are null for some teams in rare cases? And I expect other models (like players) to have similiar issues. Do you maybe have a database scheme where nullable fields are marked, which we could map to the model classes and their attributes?

As said before, I would like to be as strict as possible for model attributes, so developers using this lib don't need to check every single property of their entities. But at the moment this strict approach is useless, because it throws errors on unexpected null fields. If we can't find a "strict way", maybe I should change my mind here.

Posted: 04 May 2021 10:04

zag
Posts: 3,327
Joined: 2020-03-23

Yeh I think fundamentally users can input most kinds of data here so strictness probably isn't the best idea. Even if its good practice! I'll try and look at normalising fields but we have ALOT of them and all different kinds of data sources...


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 10 (Total: 10)