How to use openfootball data?

362 views
Skip to first unread message

Alex N.

unread,
Nov 25, 2015, 5:23:55 AM11/25/15
to opensport
https://github.com/openfootball/world-cup has a lot of data I would like to access and use.

I've downloaded worldcup.db from https://github.com/openfootball/build/releases/tag/v2014.05.18

Is there a way to view the data in worldcup.db in something like phpMyAdmin?

I'm sorry, I'm a total beginner. I'm very new to databases and github. I'm not sure at all how to start.

 I want to be able to get all the players from all the teams that have ever competed in any world cup and be able to put these players into a table in phpMyAdmin.



Gerald Bauer

unread,
Nov 25, 2015, 5:29:38 AM11/25/15
to open...@googlegroups.com
Hello,
Welcome to football.db.

To use phpMyAdmin you (just) have to import the datasets into MySQL
(using a custom build script). The tools for now are preconfigured to
use sqlite3. Note: The datasets so far do NOT include any players.

Cheers.

PS: Search this forum for mysql. For example here's a build script:

Rakefile:
---------------------

BUILD_DIR = "./build"

FOOTBALL_DB_PATH = "#{BUILD_DIR}/football.db"

DB_CONFIG = {
:adapter => 'mysql',
:database => FOOTBALL_DB_PATH
}

directory BUILD_DIR

task :clean do
rm FOOTBALL_DB_PATH if File.exists?( FOOTBALL_DB_PATH )
end

task :env => BUILD_DIR do
require 'worlddb'
require 'sportdb'
require 'logutils/db'

LogUtils::Logger.root.level = :info

pp DB_CONFIG
ActiveRecord::Base.establish_connection( DB_CONFIG )
end

task :create => :env do
LogDb.create
WorldDb.create
SportDb.create
end

task :importworld => :env do
WorldDb.read_setup( 'setups/sport.db.admin', '../world.db',
skip_tags: true ) # populate world tables
# WorldDb.stats
end

task :importsport => :env do
SportDb.read_setup( 'setups/all', '../openfootball/at-austria' )
# SportDb.stats
end

desc 'footballdb - build from scratch'
task :build => [:clean, :create, :importworld, :importsport] do
puts 'Done.'
end
Message has been deleted

Alex N.

unread,
Nov 25, 2015, 11:57:05 AM11/25/15
to opensport
Hello, thank you so much for replying. You say the datasets do not include any players, but https://github.com/openfootball/world-cup seems to have .txt files of all the players in all the teams that played each year. For example https://github.com/openfootball/world-cup/blob/master/1930--uruguay/squads/ar-argentina.txt seems to have the player names and their positions. Is this information just not yet incorporated into worldcup.db? 

If so, should I write my own parser of some sort to get the player names and positions?

Gerald Bauer

unread,
Nov 26, 2015, 4:43:14 AM11/26/15
to open...@googlegroups.com
Hello,
Good point. For now the player (and squads) datasets and import are
a work-in-progress. You're of course welcome to try out how it works
so far (but note there's not much pre-configured or tested or
definite).
Cheers.
Reply all
Reply to author
Forward
0 new messages