Skip to content
Branch: master
Find file History
Fetching latest commit…
Cannot retrieve the latest commit at this time.
Permalink
Type Name Latest commit message Commit time
..
Failed to load latest commit information.
lib/sportdb
test
.gitignore
HISTORY.md
Manifest.txt
README.md
Rakefile

README.md

sportdb-import - tools 'n' scripts for importing sports (football) data in alternate (text) formats incl. comma-separated values (csv) format"

Usage

Let's import all datafiles for all seasons (from 1888-89 to today) for England, use:

require 'sportdb/import' 

## note: requires a local copy of the football.db clubs datasets 
##          see https://github.com/openfootball/clubs
SportDb::Import.config.clubs_dir = './clubs'


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 

That's it.

License

The sportdb-import scripts are dedicated to the public domain. Use it as you please with no restrictions whatsoever.

Questions? Comments?

Send them along to the Open Sports & Friends Forum/Mailing List. Thanks!

You can’t perform that action at this time.