sportdb / sport.db Goto Github PK
View Code? Open in Web Editor NEWsport.db - open sports database (e.g. football.db, formula1.db etc.) command line tool and libraries
License: Creative Commons Zero v1.0 Universal
sport.db - open sports database (e.g. football.db, formula1.db etc.) command line tool and libraries
License: Creative Commons Zero v1.0 Universal
Hi!
First of all thanks for all the effort you spend on free sports data projects like these! :-)
I do have a problem though when using the sqlite database as the datetime fields seem to be broken. For example the games table offers play_at, created_at and updated_at, which hold values in the format 'yyyy-MM-dd HH:mm:ss' (for play_at) and 'yyyy-MM-dd HH:mm:ss.SSSSSS' (for the created and updated fields).
AFAIK sqlite3 seems to support 'yyyy-MM-dd HH:ss:SSS' only (http://www.sqlite.org/datatype3.html). The mapping within a JDBC driver won't work otherwise.
I tried to fiddle around with your code in the sport.db.ruby, specifically adding
play_at.strftime( '%Y-%m-%d %H:%M:%S.%L' )
at
https://github.com/geraldb/sport.db.ruby/blob/master/lib/sportdb/models/game.rb#L309
to fix the issue with play_at (which seemed most important ;)) but I am pretty new to ruby and failed to install/build the sportdb gem because of this:
ERROR: While executing gem ... (Gem::InvalidSpecificationException)
[".gemtest", "History.md", "data/setups/all.yml", "lib/sportdb/title.rb", "test/test_round.rb"] are not files
Any help would be much appreciated!
Cheers
Martin
Hi!
I got following issue in ruby-2.0.0, ubuntu-12.10 after sportdb setup
*** error: No such file or directory - /setups/all.yml
What could cause the problem?
Trying to install on Ubuntu 14.04.
gem install sportdb throws:
Building native extensions. This could take a while...
ERROR: Error installing sportdb:
ERROR: Failed to build gem native extension.
/usr/bin/ruby1.9.1 extconf.rb
/usr/lib/ruby/1.9.1/rubygems/custom_require.rb:36:in require': cannot load such file -- mkmf (LoadError) from /usr/lib/ruby/1.9.1/rubygems/custom_require.rb:36:in
require'
from extconf.rb:1:in `
Gem files will remain installed in /var/lib/gems/1.9.1/gems/json-1.8.1 for inspection.
Results logged to /var/lib/gems/1.9.1/gems/json-1.8.1/ext/json/ext/generator/gem_make.out
Hi,
thank you for this amazing work.
I am trying to import the full history of all worldcup by running:
sportdb new worldcup
But I only get a sqlite database with worldcup2014
If I run sportdb new worldcup2018
I only get the worldcup 2018 database
I tried unziping: world-cup-master
and found that in the setups
folder and all.txt
is having this content:
###########
# All
# Note: just latest world cup - e.g. Brazil 2014 w/ Quali(fiers)
#
# -- use history.txt for all world cups
# -- Brazil 2014 Quali(fiers)
world-cup!/2014--brazil/quali/africa
world-cup!/2014--brazil/quali/asia
world-cup!/2014--brazil/quali/europe
world-cup!/2014--brazil/quali/north_america
world-cup!/2014--brazil/quali/pacific
world-cup!/2014--brazil/quali/playoffs
world-cup!/2014--brazil/quali/south_america
# -- Brazil 2014
world-cup!/2014--brazil/cup
Is this the problem here? How can I solve it?
Thanks
Hello,
Would you think it would be possible to add a search functionality?
I am often listening to local radio stations, usually music, sometimes also sport commentary, and sometimes I'd like to search for radio stations or simply some ongoing results.
I don't know if there is an easy way for sportdb to discover this, or even independent of sportdb, but perhaps there may be some "discover" / "search" functionality that might allow us to search for something "interesting"; on the commandline?
Or in other ways: a functionality within sportdb itself that would allow us to explore some sports-related stuff, which could then be combined with other, already existing functionality within sportdb. Not sure if this makes sense or is easy to add but if anyone feels bored ... well. :)
Feel free to close this issue if it seems out of scope for the project or too much work.
UNACCENT = {
'Ä'=>'A', 'ä'=>'a',
'Á'=>'A', 'á'=>'a',
'É'=>'E', 'é'=>'e',
'Í'=>'I', 'í'=>'i',
'ï'=>'i',
'Ñ'=>'N', 'ñ'=>'n',
'Ö'=>'O', 'ö'=>'o',
'Ó'=>'O', 'ó'=>'o',
'ß'=>'ss',
'Ü'=>'U', 'ü'=>'u',
'Ú'=>'U', 'ú'=>'u',
}
PATTERN = Regexp.union(UNACCENT.keys)
def unaccent_gsub(text, mapping)
text.gsub(PATTERN, mapping)
end
text = "Apples and AÄÁaäá EÉeé IÍiíï NÑnñ OÖÓoöó Ssß UÜÚuüú"
puts unaccent_gsub(text, UNACCENT)
I just ran gem install sportdb
and the gem built just fine. However, when running sportdb
I get the following error:
$ sportdb
activerecord-utils/0.4.0 (activerecord/5.1.2) on Ruby 2.3.3 (2016-11-21) [x86_64-darwin16]
/Users/swh/.rbenv/versions/2.3.3/lib/ruby/gems/2.3.0/gems/activerecord-5.1.2/lib/active_record/migration.rb:525:in `inherited': Directly inheriting from ActiveRecord::Migration is not supported. Please specify the Rails release the migration was written for: (StandardError)
class ConfDb::CreateDb < ActiveRecord::Migration[4.2]
from /Users/swh/.rbenv/versions/2.3.3/lib/ruby/gems/2.3.0/gems/props-activerecord-0.1.0/lib/props/activerecord/schema.rb:5:in `<module:ConfDb>'
from /Users/swh/.rbenv/versions/2.3.3/lib/ruby/gems/2.3.0/gems/props-activerecord-0.1.0/lib/props/activerecord/schema.rb:3:in `<top (required)>'
from /Users/swh/.rbenv/versions/2.3.3/lib/ruby/2.3.0/rubygems/core_ext/kernel_require.rb:68:in `require'
from /Users/swh/.rbenv/versions/2.3.3/lib/ruby/2.3.0/rubygems/core_ext/kernel_require.rb:68:in `require'
from /Users/swh/.rbenv/versions/2.3.3/lib/ruby/gems/2.3.0/gems/activesupport-5.1.2/lib/active_support/dependencies.rb:292:in `block in require'
from /Users/swh/.rbenv/versions/2.3.3/lib/ruby/gems/2.3.0/gems/activesupport-5.1.2/lib/active_support/dependencies.rb:258:in `load_dependency'
from /Users/swh/.rbenv/versions/2.3.3/lib/ruby/gems/2.3.0/gems/activesupport-5.1.2/lib/active_support/dependencies.rb:292:in `require'
from /Users/swh/.rbenv/versions/2.3.3/lib/ruby/gems/2.3.0/gems/props-activerecord-0.1.0/lib/props/activerecord.rb:14:in `<top (required)>'
from /Users/swh/.rbenv/versions/2.3.3/lib/ruby/2.3.0/rubygems/core_ext/kernel_require.rb:68:in `require'
from /Users/swh/.rbenv/versions/2.3.3/lib/ruby/2.3.0/rubygems/core_ext/kernel_require.rb:68:in `require'
from /Users/swh/.rbenv/versions/2.3.3/lib/ruby/gems/2.3.0/gems/activesupport-5.1.2/lib/active_support/dependencies.rb:292:in `block in require'
from /Users/swh/.rbenv/versions/2.3.3/lib/ruby/gems/2.3.0/gems/activesupport-5.1.2/lib/active_support/dependencies.rb:258:in `load_dependency'
from /Users/swh/.rbenv/versions/2.3.3/lib/ruby/gems/2.3.0/gems/activesupport-5.1.2/lib/active_support/dependencies.rb:292:in `require'
from /Users/swh/.rbenv/versions/2.3.3/lib/ruby/gems/2.3.0/gems/worlddb-models-2.3.4/lib/worlddb/models.rb:30:in `<top (required)>'
from /Users/swh/.rbenv/versions/2.3.3/lib/ruby/2.3.0/rubygems/core_ext/kernel_require.rb:68:in `require'
from /Users/swh/.rbenv/versions/2.3.3/lib/ruby/2.3.0/rubygems/core_ext/kernel_require.rb:68:in `require'
from /Users/swh/.rbenv/versions/2.3.3/lib/ruby/gems/2.3.0/gems/sportdb-models-1.16.2/lib/sportdb/models.rb:8:in `<top (required)>'
from /Users/swh/.rbenv/versions/2.3.3/lib/ruby/2.3.0/rubygems/core_ext/kernel_require.rb:68:in `require'
from /Users/swh/.rbenv/versions/2.3.3/lib/ruby/2.3.0/rubygems/core_ext/kernel_require.rb:68:in `require'
from /Users/swh/.rbenv/versions/2.3.3/lib/ruby/gems/2.3.0/gems/sportdb-1.11.0/lib/sportdb.rb:4:in `<top (required)>'
from /Users/swh/.rbenv/versions/2.3.3/lib/ruby/2.3.0/rubygems/core_ext/kernel_require.rb:127:in `require'
from /Users/swh/.rbenv/versions/2.3.3/lib/ruby/2.3.0/rubygems/core_ext/kernel_require.rb:127:in `rescue in require'
from /Users/swh/.rbenv/versions/2.3.3/lib/ruby/2.3.0/rubygems/core_ext/kernel_require.rb:40:in `require'
from /Users/swh/.rbenv/versions/2.3.3/lib/ruby/gems/2.3.0/gems/sportdb-1.11.0/bin/sportdb:3:in `<top (required)>'
from /Users/swh/.rbenv/versions/2.3.3/bin/sportdb:22:in `load'
from /Users/swh/.rbenv/versions/2.3.3/bin/sportdb:22:in `<main>'
It looks like it has an issue with the class inherting from ActiveRecord::Migration
directly on this line in props-activerecord, but I have no idea what the best way to deal with it is since it looks like a pretty deeply-nested dep.
I ran the following commands to obtain a SQLite database for the Bundesliga:
gem install sportdb
# I couldn't run sportdb new de without the following extra dependencies
gem install sportdb-langs sportdb-service
sportdb new de
I then uploaded the resulting SQLite file to my research project, which has a database visualisation component. The resulting visual schema doesn't look like it detected any foreign keys (image behind link).
I then briefly checked the leagues table and it doesn't seem to specify any foreign key.
CREATE TABLE "leagues" (
"id" integer NOT NULL PRIMARY KEY AUTOINCREMENT,
"key" varchar NOT NULL,
"title" varchar NOT NULL,
"country_id" integer,
"club" boolean NOT NULL DEFAULT 0,
"created_at" datetime(6) NOT NULL,
"updated_at" datetime(6) NOT NULL
);
On Windows 10 + ruby 2.5, i get the below error when calling "sportdb new en"
*** error: undefined method `get_input_stream' for nil:NilClass
Can you help?
Heres the preceeding output...
[info] parsing data in zip 'setups/all' (eng-england-master/setups/all.txt)...
[info] parsing data in zip (league) 'eng-england!/leagues' (eng-england-master/leagues.txt)...
DEPRECATION WARNING: update_attributes! is deprecated and will be removed from Rails 6.1 (please, use update! instead) (called from load at C:/Ruby25-x64/bin/sportdb:23)
DEPRECATION WARNING: update_attributes! is deprecated and will be removed from Rails 6.1 (please, use update! instead) (called from load at C:/Ruby25-x64/bin/sportdb:23)
DEPRECATION WARNING: update_attributes! is deprecated and will be removed from Rails 6.1 (please, use update! instead) (called from load at C:/Ruby25-x64/bin/sportdb:23)
DEPRECATION WARNING: update_attributes! is deprecated and will be removed from Rails 6.1 (please, use update! instead) (called from load at C:/Ruby25-x64/bin/sportdb:23)
[info] parsing data in zip (team) 'eng-england!/clubs/1-premierleague' (eng-england-master/clubs/1-premierleague.txt)...
*** error: undefined method `get_input_stream' for nil:NilClass
I've noticed that this is using the sinatra default and I can't find a way to override it. Could you advise if this is possible in the current setup
A declarative, efficient, and flexible JavaScript library for building user interfaces.
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google ❤️ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.