How update results ?

38 views
Skip to first unread message

Guillaume Cren

unread,
Jun 23, 2020, 12:03:01 PM6/23/20
to opensport
Hello Gerald,

I'm new on your repos (also on GitHub) and i want to update your "../2019-20/en.1.json" file with results of the week.

I just have to checkout, update and push the en.1.json file with my commit ? Is there any verification, or maybe i've to start a specific branch ?

Thanks for your answer.

Guillaume

Gerald Bauer

unread,
Jun 23, 2020, 12:18:53 PM6/23/20
to open...@googlegroups.com
Hello Guillaume,
Thanks for your offer and for trying.

The new plan is that I try to get an update pushed once a week on
Wednesday (and after some week maybe or hopefully some automation
going). You can find the update scripts @
https://github.com/yorobot/football.json

But yeah sorry - the reality is it always takes way longer,
Anyways, if you try to update you a single season it might be best to
start from scratch, that is, write a new script / use your own script
e.g. something like:

require 'sportdb/readers'

SportDb.connect( adapter: 'sqlite3',
database: './england.db' )
# build database schema (tables, indexes, etc.)
SportDb.create_all

# local copy, see [1]
SportDb.read( './england/blob/master/2019-20/1-premierleague.txt' )

and last step export to json
maybe use script from football.json, see scripts/json.rb for example.

All the best. Let us know how it goes or if you are stuck. Cheers. Prost.


[1] https://github.com/openfootball/england/blob/master/2019-20/1-premierleague.txt
[2] https://github.com/yorobot/football.json/blob/master/scripts/json.rb

Gerald Bauer

unread,
Jun 23, 2020, 12:29:21 PM6/23/20
to open...@googlegroups.com
Hello,
FYI: Some weeks ago I posted a little note / write-up on
generating JSON datasets, see [1]

If you replace

## assumes football.db datasets for England in local ./england directory
SportDb.read( './england' )

with

## just read the latest season
SportDb.read( './england/2019-20/1-premierleague.txt' )

That should work.

Of course - you are more than welcome to use any other scripts or
language for the JSON generation. Let us know how it goes / what you
decide..

[1] https://github.com/sportdb/docs/blob/master/generating-json-datasets.md

cren.gu...@gmail.com

unread,
Jun 25, 2020, 1:18:34 PM6/25/20
to opensport
Hello,

Thanks for all these informations. I'm trying to do this. But, how can i add the "sportdb/readers" ? (i don't know the "require") I've to clone the repos dans add the source in mine ?

Thanks.

cren.gu...@gmail.com

unread,
Jun 25, 2020, 1:41:45 PM6/25/20
to opensport
For the moment i've clone the openfootball/football.json/master/2019-20/en.1.json in my repos, and i update it localy.

Gerald Bauer

unread,
Jun 25, 2020, 5:01:39 PM6/25/20
to open...@googlegroups.com
Hello,

> But, how can i add the "sportdb/readers" ? (i don't know the "require")

Sorry for the missing information.
I use the Ruby scripting language (it's like Python) for all scripts.
Once you have Ruby [1] installed on your system you can install the
sportdb tooling via ruby's package manager (called gem):

$ gem install sportdb-readers # see [1]

And the require (is ruby's version of python's import) to use
"third-party" libraries / scripts (called gems). Anyways, you're free
to use whatever script / language you prefer.

[1] https://rubygems.org/gems/sportdb-readers

Gerald Bauer

unread,
Jun 25, 2020, 5:04:56 PM6/25/20
to open...@googlegroups.com
Hello,

> For the moment i've clone the openfootball/football.json/master/2019-20/en.1.json in my repos, and i update it localy.

You're more than welcome to share your link to your repo. I you
send a pull request I can merge. Cheers. Prost.

PS:
BUT note as written on the README your changes will get overwritten
with the next update via the "classic" script. Realistically I will
get to it in about two or three days at the earliest.
Reply all
Reply to author
Forward
0 new messages