Hello,
I've written up / published a new from zero / scratch getting
started guide for importing football.csv packages [1]
into an SQL database. The example uses all English football leagues, clubs
and matches (from 1888-89 to today) [2]. The steps include:
- Step 0: Setup - Install the Sport.db Libraries
- Step 1: Download (or Clone) the CSV Package / Datasets
- Step 2: Add the Import / Build Script
build.rb:
require 'sportdb/import'
SportDb.connect( adapter: 'sqlite3',
database: './eng.db' )
## build database schema / tables
SportDb.create_all
## turn on logging to console
ActiveRecord::Base.logger = Logger.new(STDOUT)
## note: requires a local copy of the football.csv england datasets
## see https://github.com/footballcsv/england
pack = CsvMatchImporter.new( './england' )
pack.import_leagues
- Step 3: Kick off and Run
That's it. Enjoy the beautiful game. Cheers. Prost.
[1] https://github.com/sportdb/docs/blob/master/working-with-csv-packages.md
[2] https://github.com/footballcsv/england