fifadat 0.0.1 → 2026.9.30

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (94) hide show
  1. checksums.yaml +4 -4
  2. data/CHANGELOG.md +1 -0
  3. data/Manifest.txt +64 -82
  4. data/Rakefile +2 -2
  5. data/{lib/fifadat/config → config}/seasons/at.csv +1 -0
  6. data/{lib/fifadat/config → config}/seasons/at.cup.csv +1 -0
  7. data/{lib/fifadat/config → config}/seasons/au.csv +1 -0
  8. data/{lib/fifadat/config → config}/seasons/be.csv +1 -0
  9. data/{lib/fifadat/config → config}/seasons/ch.csv +1 -0
  10. data/{lib/fifadat/config → config}/seasons/cz.csv +1 -0
  11. data/{lib/fifadat/config → config}/seasons/de.2.csv +1 -0
  12. data/{lib/fifadat/config → config}/seasons/de.csv +1 -0
  13. data/{lib/fifadat/config → config}/seasons/de.cup.csv +1 -0
  14. data/{lib/fifadat/config → config}/seasons/eg.csv +1 -0
  15. data/{lib/fifadat/config → config}/seasons/eng.2.csv +1 -0
  16. data/{lib/fifadat/config → config}/seasons/eng.csv +1 -0
  17. data/{lib/fifadat/config → config}/seasons/eng.facup.csv +1 -0
  18. data/{lib/fifadat/config → config}/seasons/es.csv +1 -0
  19. data/{lib/fifadat/config → config}/seasons/fr.csv +1 -0
  20. data/{lib/fifadat/config → config}/seasons/gr.csv +1 -0
  21. data/{lib/fifadat/config → config}/seasons/hu.csv +1 -0
  22. data/{lib/fifadat/config → config}/seasons/il.csv +1 -0
  23. data/{lib/fifadat/config → config}/seasons/interconticup.csv +1 -1
  24. data/{lib/fifadat/config → config}/seasons/is.csv +1 -1
  25. data/{lib/fifadat/config → config}/seasons/it.csv +1 -0
  26. data/{lib/fifadat/config → config}/seasons/it.cup.csv +1 -0
  27. data/{lib/fifadat/config → config}/seasons/lu.csv +1 -0
  28. data/{lib/fifadat/config → config}/seasons/ma.csv +1 -0
  29. data/{lib/fifadat/config → config}/seasons/mx.csv +1 -0
  30. data/{lib/fifadat/config → config}/seasons/nir.csv +1 -0
  31. data/{lib/fifadat/config → config}/seasons/nl.csv +1 -0
  32. data/{lib/fifadat/config → config}/seasons/pl.csv +1 -0
  33. data/{lib/fifadat/config → config}/seasons/pt.csv +1 -0
  34. data/{lib/fifadat/config → config}/seasons/sa.csv +1 -0
  35. data/{lib/fifadat/config → config}/seasons/sco.csv +1 -0
  36. data/{lib/fifadat/config → config}/seasons/tn.csv +1 -0
  37. data/{lib/fifadat/config → config}/seasons/tr.csv +1 -0
  38. data/{lib/fifadat/config → config}/seasons/uefa.cl.csv +1 -0
  39. data/{lib/fifadat/config → config}/seasons/uefa.con.csv +1 -0
  40. data/{lib/fifadat/config → config}/seasons/uefa.europa.csv +1 -0
  41. data/{lib/fifadat/config → config}/seasons/wal.csv +1 -0
  42. data/{lib/fifadat/config → config}/seasons/za.csv +1 -0
  43. data/lib/fifadat/api.rb +59 -0
  44. data/lib/fifadat/{api-config.rb → config.rb} +4 -9
  45. data/lib/fifadat/helper.rb +6 -0
  46. data/lib/fifadat/pp/ppdebug.rb +69 -0
  47. data/lib/fifadat/pp/ppstats.rb +97 -0
  48. data/lib/fifadat/prepare.rb +48 -12
  49. data/lib/fifadat/types.rb +55 -19
  50. data/lib/fifadat/version.rb +19 -0
  51. data/lib/fifadat.rb +10 -35
  52. metadata +66 -85
  53. data/bin/fifadat +0 -14
  54. data/lib/fifadat/errata.rb +0 -59
  55. data/lib/fifadat/pp/build_match.rb +0 -105
  56. data/lib/fifadat/pp/build_report.rb +0 -135
  57. data/lib/fifadat/pp/convert-reports.rb +0 -114
  58. data/lib/fifadat/pp/convert.rb +0 -163
  59. data/lib/fifadat/pp/goals-calc_score.rb +0 -58
  60. data/lib/fifadat/pp/goals.rb +0 -89
  61. data/lib/fifadat/pp/helper-date.rb +0 -13
  62. data/lib/fifadat/pp/helper-minute.rb +0 -81
  63. data/lib/fifadat/pp/helper-score.rb +0 -139
  64. data/lib/fifadat/pp/norm.rb +0 -34
  65. data/lib/fifadat/pp/officials.rb +0 -86
  66. data/lib/fifadat/pp/penalties.rb +0 -132
  67. data/lib/fifadat/pp/players.rb +0 -323
  68. data/lib/fifadat/pp/stadiums.rb +0 -99
  69. data/lib/fifadat/pp/stages.rb +0 -119
  70. data/lib/fifadat/pp/substitutions.rb +0 -444
  71. data/lib/fifadat/pp/teams.rb +0 -91
  72. data/lib/fifadat/ppdebug.rb +0 -128
  73. data/lib/fifadat/tool.rb +0 -184
  74. /data/{lib/fifadat/config → config}/codes_club-europe.csv +0 -0
  75. /data/{lib/fifadat/config → config}/codes_club.csv +0 -0
  76. /data/{lib/fifadat/config → config}/codes_nati.csv +0 -0
  77. /data/{lib/fifadat/config → config}/seasons/ar.csv +0 -0
  78. /data/{lib/fifadat/config → config}/seasons/br.csv +0 -0
  79. /data/{lib/fifadat/config → config}/seasons/clubworldcup.csv +0 -0
  80. /data/{lib/fifadat/config → config}/seasons/cn.csv +0 -0
  81. /data/{lib/fifadat/config → config}/seasons/co.csv +0 -0
  82. /data/{lib/fifadat/config → config}/seasons/copa.l.csv +0 -0
  83. /data/{lib/fifadat/config → config}/seasons/copa.s.csv +0 -0
  84. /data/{lib/fifadat/config → config}/seasons/ie.csv +0 -0
  85. /data/{lib/fifadat/config → config}/seasons/jp.csv +0 -0
  86. /data/{lib/fifadat/config → config}/seasons/kr.csv +0 -0
  87. /data/{lib/fifadat/config → config}/seasons/mls.csv +0 -0
  88. /data/{lib/fifadat/config → config}/seasons/mx.2.csv +0 -0
  89. /data/{lib/fifadat/config → config}/seasons/mx.cup.csv +0 -0
  90. /data/{lib/fifadat/config → config}/seasons/no.csv +0 -0
  91. /data/{lib/fifadat/config → config}/seasons/se.csv +0 -0
  92. /data/{lib/fifadat/config → config}/seasons/uy.csv +0 -0
  93. /data/{lib/fifadat/config → config}/seasons/worldcup.csv +0 -0
  94. /data/lib/fifadat/{ppmatch.rb → pp/ppmatch.rb} +0 -0
@@ -0,0 +1,69 @@
1
+
2
+
3
+
4
+ def pp_debug( data )
5
+
6
+ errors = []
7
+
8
+
9
+ matches = data['Results'] ## only use results (match) array
10
+
11
+ ## get SeasonName from first match
12
+ m = matches[0]
13
+ competitionName = desc( m['CompetitionName'])
14
+ seasonName = desc( m['SeasonName'])
15
+
16
+
17
+ ## pp data
18
+ puts " #{matches.size} match(es) in #{competitionName} / #{seasonName}"
19
+
20
+
21
+ buf = String.new
22
+
23
+ matches.each_with_index do |m, i|
24
+
25
+
26
+ ## todo -- log match details
27
+ ## if matchstatus not 0,1
28
+ ## or result type not 0,1,2,3,4,5 !!!
29
+
30
+
31
+ buf << "==> [#{i+1}/#{matches.size}] "
32
+ buf << pp_match(m)
33
+
34
+
35
+ idMatch = m['IdMatch']
36
+
37
+ matchStatus = m['MatchStatus']
38
+ resultType = m['ResultType']
39
+
40
+ ## add aggregate score too
41
+ score = [m['HomeTeamScore'], m['AwayTeamScore']].compact
42
+ penScore = [m['HomeTeamPenaltyScore'], m['AwayTeamPenaltyScore']].compact
43
+ aggScore = [m['AggregateHomeTeamScore'],m['AggregateAwayTeamScore']].compact
44
+
45
+
46
+ if resultType == 0 && !score.empty?
47
+ ## pachuca vs salzburg in cwc 2025??
48
+ ## double check if score present
49
+ ## raise ArgumentError,
50
+ ## " resultType == 0 but score present idMatch #{m['IdMatch']} #{m['HomeTeamScore']}-#{m['AwayTeamScore']}"
51
+
52
+ msg = " resultType == 0 but score present idMatch #{idMatch} #{score.inspect}"
53
+ errors << msg
54
+ end
55
+
56
+ if ![0,1,9].include?(matchStatus)
57
+ msg = "matchStatus 0-END,1-SCHED,9-AWD expected; got #{matchStatus} in: #{m.pretty_inspect}"
58
+ errors << msg
59
+ end
60
+
61
+ if ![0,1,2,3,4,5,8,12].include?(resultType)
62
+ msg = "resultType 0,1,2,3,4,5,8,12 expected; got #{resultType} in: #{m.pretty_inspect}"
63
+ errors << msg
64
+ end
65
+ end
66
+
67
+
68
+ [buf, errors]
69
+ end
@@ -0,0 +1,97 @@
1
+
2
+
3
+
4
+ class Counter
5
+ def initialize( types )
6
+ @types = types
7
+ @counter = Hash.new(0)
8
+ end
9
+
10
+ def [](key) @counter[key]; end
11
+ def []=(key,value) @counter[key]=value; end
12
+
13
+ def pretty_print(q)
14
+ q.group(1, "{", "}") do
15
+ ## sort by keys
16
+ pairs = @counter.sort_by { |key,_| key }
17
+ pairs.each_with_index do |(key,count),i|
18
+ q.breakable(', ') if i != 0
19
+ q.text( "#{key}-#{(@types[key]||'??')}=>#{count}")
20
+ end
21
+ end
22
+ end
23
+
24
+ end ## class Counter
25
+
26
+
27
+
28
+ def mk_stats
29
+ stats = {
30
+ ## match stats
31
+ 'MatchStatus' => Counter.new( MATCH_STATUS ),
32
+ 'ResultType' => Counter.new( RESULT_TYPE ),
33
+ 'TimeDefined' => Hash.new(0),
34
+
35
+ 'MatchDay' => Hash.new(0),
36
+ 'MatchNumber' => Hash.new(0),
37
+ 'Leg' => Hash.new(0),
38
+ 'IsHomeMatch' => Hash.new(0),
39
+
40
+ 'Attendance' => Hash.new(0),
41
+ 'Weather' => Hash.new(0),
42
+
43
+ ## add stage & group
44
+ ## add agg score and pen score!!
45
+
46
+
47
+ ## team stats
48
+ ## 'TeamType' => Hash.new(0),
49
+ ## 'AgeType' => Hash.new(0),
50
+ ## 'FootballType' => Hash.new(0),
51
+ }
52
+
53
+ stats
54
+ end
55
+
56
+
57
+
58
+ def collect_stats( data, stats: )
59
+
60
+ ## use results (match) array
61
+ data['Results'].each_with_index do |m, i|
62
+
63
+
64
+ ##
65
+ ## check usage
66
+ stats[ 'MatchStatus' ][m['MatchStatus']] +=1
67
+ stats[ 'ResultType'][m['ResultType']] +=1
68
+
69
+ stats[ 'TimeDefined'][m['TimeDefined']] +=1
70
+
71
+
72
+ stats[ 'MatchDay'][!m['MatchDay'].nil?] +=1
73
+ stats[ 'MatchNumber'][!m['MatchNumber'].nil?] +=1
74
+
75
+ stats[ 'Leg'][m['Leg']] +=1
76
+ stats[ 'IsHomeMatch'][m['IsHomeMatch']] +=1
77
+
78
+ stats[ 'Attendance'][!m['MatchDay'].nil?] +=1
79
+ stats[ 'Weather'][!m['Weather'].nil?] +=1
80
+
81
+ =begin
82
+ if m['Home']
83
+ stats[ 'TeamType'][m['Home']['TeamType']] +=1
84
+ stats[ 'AgeType'][m['Home']['AgeType']] +=1
85
+ stats[ 'FootballType'][m['Home']['FootballType']] +=1
86
+ end
87
+ if m['Away']
88
+ stats[ 'TeamType'][m['Away']['TeamType']] +=1
89
+ stats[ 'AgeType'][m['Away']['AgeType']] +=1
90
+ stats[ 'FootballType'][m['Away']['FootballType']] +=1
91
+ end
92
+ =end
93
+
94
+ end
95
+
96
+ stats
97
+ end
@@ -22,6 +22,9 @@ def prepare( name:,
22
22
  fetch_json_if( Fifa::Metal.matches_url( idSeason: idSeason ),
23
23
  "#{outdir}/#{name}/#{season.to_path}_matches.json", force: force )
24
24
 
25
+ fetch_json_if( Fifa::Metal.teams_url( idSeason: idSeason ),
26
+ "#{outdir}/#{name}/misc/#{season.to_path}_teams.json", force: force )
27
+
25
28
  fetch_json_if( Fifa::Metal.stages_url( idSeason: idSeason ),
26
29
  "#{outdir}/#{name}/misc/#{season.to_path}_stages.json", force: force )
27
30
 
@@ -45,7 +48,8 @@ def prepare_reports( name:,
45
48
  matches = data['Results']
46
49
 
47
50
 
48
- puts " #{matches.size} match(es) in season #{season}"
51
+ puts "==> prepare reports - #{matches.size} match(es) in #{name} #{season}"
52
+
49
53
 
50
54
 
51
55
  matches.each_with_index do |m, i|
@@ -54,8 +58,6 @@ def prepare_reports( name:,
54
58
  idStage = m['IdStage']
55
59
  idMatch = m['IdMatch']
56
60
 
57
- stageName = desc( m['StageName'] )
58
-
59
61
 
60
62
  ## note - skip if teams not yet know
61
63
  ## e.g. Home & Away is null
@@ -66,14 +68,34 @@ def prepare_reports( name:,
66
68
  ## e.g. MatchStatus = 1 -- future
67
69
  ## ResultType = 0 -- not played yet
68
70
 
71
+ ## if not yet played!!!
72
+ # 1-scheduled and
73
+ # 2-live
74
+ # 7-postponed !!!! (too)
75
+ # return empty score!!!
76
+ if m['MatchStatus'] == 1 ||
77
+ m['MatchStatus'] == 2 ||
78
+ m['MatchStatus'] == 7
79
+ ## skip scheduled/live matches (not yet played)
80
+ next
81
+ end
82
+
83
+
84
+
85
+
69
86
  if m['Home'].nil? || m['Away'].nil?
70
87
  puts "[#{i+1}/#{matches.size}] ?? ??, #{stageName} (SKIPPED - TO BE DONE)"
71
88
  next
72
89
  end
73
90
 
74
91
 
75
- dateTime = parse_date( m['Date'] ) ## utc
76
- localDateTime = parse_date( m['LocalDate'] )
92
+ ### note - date is always utc without timezone even if local!!
93
+ ## local is utc (plus/minus offset)!!!
94
+ ## e.g.
95
+ ## "Date": "2026-08-02T15:00:00Z",
96
+ ## "LocalDate": "2026-08-02T17:00:00Z",
97
+ dateTime = parse_date_utc( m['Date'] ) ## utc
98
+ localDateTime = parse_date_utc( m['LocalDate'] )
77
99
 
78
100
 
79
101
  ## pp m['Home']
@@ -84,8 +106,21 @@ def prepare_reports( name:,
84
106
  teamName2 = desc( m['Away']['TeamName'] )
85
107
  teamCode2 = m['Away']['Abbreviation']
86
108
 
109
+ stageName = desc( m['StageName'] )
110
+ ## "MatchDay": null,
111
+ matchday = m['MatchDay'] || '∅'
112
+ groupName = desc( m['GroupName'] )
113
+
114
+ print "[#{i+1}/#{matches.size}] "
115
+ print MATCH_STATUS[m['MatchStatus']]||"???-#{m['MatchStatus']}"
116
+ print "/"
117
+ print RESULT_TYPE[m['ResultType']]||"???-#{m['ResultType']}"
118
+ print " #{teamName1} (#{teamCode1}) v #{teamName2} (#{teamCode2})"
119
+ print " | #{stageName} - #{matchday}"
120
+ print ", #{groupName}" if groupName
121
+ print " | #{localDateTime}"
122
+ print "\n"
87
123
 
88
- puts "[#{i+1}/#{matches.size}] #{teamName1} #{teamName2}, #{stageName}, #{localDateTime}"
89
124
 
90
125
 
91
126
  outpath = "#{outdir}/#{name}/matches/#{season.to_path}/#{localDateTime.strftime('%Y-%m-%d')}_#{teamCode1}-#{teamCode2}__#{idMatch}.json"
@@ -93,7 +128,7 @@ def prepare_reports( name:,
93
128
  url = Fifa::Metal.live_url( idCompetition: idCompetition,
94
129
  idSeason: idSeason,
95
130
  idStage: idStage,
96
- idMatch: idMatch )
131
+ idMatch: idMatch )
97
132
 
98
133
  fetch_json_if( url, outpath, force: force )
99
134
 
@@ -101,15 +136,16 @@ def prepare_reports( name:,
101
136
  ###
102
137
  ## add timeline (only) if score incl. penalty shoot-out
103
138
  resultType = m['ResultType']
104
- if resultType == 2 ## (aet??) win on pens
139
+ if resultType == 2 ## WIN_ON_PENS
105
140
 
106
141
  ## download timeline
107
142
  outpath = "#{outdir}/#{name}/timelines/#{season.to_path}/#{localDateTime.strftime('%Y-%m-%d')}_#{teamCode1}-#{teamCode2}__#{idMatch}.json"
108
143
 
109
- url = Fifa::Metal.timeline_url( idCompetition: idCompetition,
110
- idSeason: idSeason,
111
- idStage: idStage,
112
- idMatch: idMatch )
144
+ # url = Fifa::Metal.timeline_url( idCompetition: idCompetition,
145
+ # idSeason: idSeason,
146
+ # idStage: idStage,
147
+ # idMatch: idMatch )
148
+ url = Fifa::Metal.timeline_url( idMatch:idMatch )
113
149
 
114
150
  fetch_json_if( url, outpath, force: force )
115
151
  end
data/lib/fifadat/types.rb CHANGED
@@ -7,16 +7,16 @@
7
7
 
8
8
 
9
9
  MATCH_STATUS = {
10
- 0 => 'FIN', # finished
11
- 1 => 'SCHED', # scheduled (with or without time - see timed flag)
10
+ 0 => 'END', # finished
11
+ 1 => 'SCHEDULED', # scheduled (with or without time - see timed flag)
12
12
  2 => 'LIVE',
13
13
 
14
14
  ## ???
15
15
 
16
- 7 => 'POSTPONED', # postponed
16
+ 7 => 'POSTPONED', # postponed - use PPD ??
17
17
 
18
18
  9 => 'AWD', # awarded !!!
19
- # check if 9/0 is possibly cancelled/annulled (if no score)
19
+ # check if 9/0 is possibly cancelled/annulled/walkover (if no score)
20
20
  # 9/12 (AWD 3-0 or such)
21
21
 
22
22
  }
@@ -61,18 +61,19 @@ RESULT_TYPE = {
61
61
  ## is after extra-time!!!
62
62
  ## used many times in copa libertadores
63
63
  ## check gold cup too
64
- 2 => 'AET_WIN_ON_PENS', ## or REG_WIN_ON_PENS or AGG_WIN_ON_PENS !!!!!!
64
+ ## change to WIN_ON_PENS only - why? why not?
65
+ 2 => 'WIN_ON_PENS', ## AET_WIN_ON_PENS or REG_WIN_ON_PENS or AGG_WIN_ON_PENS !!!!!!
65
66
  3 => 'AET',
66
67
  ##
67
68
  ## note - agg - used for 1st & 2nd leg
68
69
  4 => 'REGULAR/AGG', ## aggregate (1st/2nd leg) - regular
69
70
  5 => 'AET/AGG', ## aggregate - after extra-time
70
71
  ## e.g.
71
- ## 2nd LegFeb 25, 2026 Juventus 3–2 (AET) Galatasaray
72
+ ## 2nd Leg Feb 25, 2026 Juventus 3–2 (AET) Galatasaray
72
73
  ##
73
74
  8 => 'AET/GG', ## after extra-time/golden goal !!!
74
75
 
75
- 12 => 'AWD', ## AWARDED
76
+ 12 => 'AWD', ## AWARDED or ???
76
77
  }
77
78
 
78
79
 
@@ -83,19 +84,19 @@ GOAL_TYPE = {
83
84
  }
84
85
 
85
86
 
87
+ ## use PERIOD only - why? why not?
86
88
  PERIOD_TYPE = {
87
- ## "MatchMinute": "0'", "1'", "45'+2'",
88
- 3 => '1ST_HALF',
89
- ## "MatchMinute": "46'", "90'+2'",
90
- 5 => '2ND_HALF',
91
- ## "MatchMinute": "91'", "105'+2'",
92
- 7 => 'EXTRA_TIME_1ST_HALF',
93
- ## "MatchMinute": "106'", "120'+2'",
89
+ 3 => '1ST_HALF', ## "MatchMinute": "0'", "1'", "45'+2'",
90
+ 4 => 'HALF', ## "MatchMinute": "46'", "90'+2'",
91
+ 5 => '2ND_HALF', ## "MatchMinute": "91'", "105'+2'",
92
+ 6 => 'EXTRA_TIME', ## or end of regular time??
93
+ 7 => 'EXTRA_TIME_1ST_HALF', ## "MatchMinute": "106'", "120'+2'",
94
+ 8 => 'EXTRA_TIME_HALF',
94
95
  9 => 'EXTRA_TIME_2ND_HALF',
95
- ## "MatchMinute": "120'", "121'", "122'", "123'",
96
- 11 => 'PENALTY_SHOOTOUT',
97
- ## "MatchMinute": "127'", "130'",
98
- 10 => 'MATCH_END'
96
+ 10 => 'END', ## or use MATCH_END ???
97
+ ## (generic incl. optional extra time and/or penalty shootout)
98
+ 11 => 'PENALTY_SHOOTOUT', ## "MatchMinute": "120'", "121'", "122'", "123'",
99
+ ## "MatchMinute": "127'", "130'",
99
100
  }
100
101
 
101
102
  =begin
@@ -141,7 +142,42 @@ EVENT_TYPE = {
141
142
 
142
143
 
143
144
 
144
- =begin
145
+ __END__
146
+
147
+
148
+
149
+ TeamType
150
+ 0 => club
151
+ 1 => nati(onal) team
152
+ AgeType
153
+ 0 => ??
154
+ 1 => U17 U-17 World Cup / U17 National Team Friendlies
155
+ MLS Generation Cup U17
156
+ 2 => U18 U18 National Team Friendlies
157
+ U18 Premier League Cup
158
+ 3 => U19 U19 Championship Qualification
159
+ 4 => U20 U-20 World Cup / CONMEBOL U20
160
+
161
+ 5 => ?? Olympic Football Tournament / Olympics Intercontinental Play-offs /
162
+ AFC U23 Asian Cup
163
+
164
+ 10 => U15 U15 National Team Friendlies
165
+ MLS Generation Cup U15
166
+ 11 => U16 U16 National Team Friendlies
167
+ 12 => U21 U21 Championship / Tournoi Maurice Revello /
168
+ U21 National Team Friendlies
169
+ Premier League 2
170
+
171
+ 14 => ?? U23 U23 National Team Friendlies / Asian Games
172
+
173
+ FootballType
174
+ 0 => "classic"
175
+ 1 => Futsal
176
+ 2 => Beach Soccer
177
+ Gender
178
+ 1 => m
179
+ 2 => f
180
+
145
181
 
146
182
  note - matchStatus for 12-AWD should also be 9-AWD!!!
147
183
 
@@ -0,0 +1,19 @@
1
+
2
+ module Fifadat ## use FifaApi or such - why? why not
3
+ MAJOR = 2026 ## todo: namespace inside version or something - why? why not??
4
+ MINOR = 9
5
+ PATCH = 30
6
+ VERSION = [MAJOR,MINOR,PATCH].join('.')
7
+
8
+ def self.version
9
+ VERSION
10
+ end
11
+
12
+ def self.banner
13
+ "fifadat/#{VERSION} on Ruby #{RUBY_VERSION} (#{RUBY_RELEASE_DATE}) [#{RUBY_PLATFORM}] in (#{root})"
14
+ end
15
+
16
+ def self.root
17
+ File.expand_path( File.dirname(File.dirname(File.dirname(__FILE__))) )
18
+ end
19
+ end # module Fifadat
data/lib/fifadat.rb CHANGED
@@ -1,3 +1,8 @@
1
+ ##
2
+ ## note - always use latest (local) version if present
3
+ $LOAD_PATH.unshift( '/sports/rubycocos/webclient/webclient/lib' )
4
+ $LOAD_PATH.unshift( '/sports/rubycocos/webclient/webget/lib' )
5
+
1
6
  require 'cocos' ## check if incl webclient already?
2
7
  require 'webclient'
3
8
 
@@ -5,50 +10,20 @@ require 'season-formats'
5
10
 
6
11
 
7
12
 
8
-
9
13
  require_relative 'fifadat/json' ## read_json_v2, fetch_json, fetch_json_if, etc.
10
14
 
11
15
 
12
16
 
13
17
  ###
14
18
  ## our own code
19
+ require_relative 'fifadat/version'
15
20
 
16
- require_relative 'fifadat/api-config' ## base
17
- require_relative 'fifadat/api' ## base
18
21
  require_relative 'fifadat/helper'
19
- require_relative 'fifadat/prepare' ## "all-in-one" prepare (download cache) helpers etc.
20
-
21
- require_relative 'fifadat/ppdebug'
22
- require_relative 'fifadat/ppmatch'
23
-
22
+ require_relative 'fifadat/config'
23
+ require_relative 'fifadat/api'
24
24
  require_relative 'fifadat/types'
25
- require_relative 'fifadat/errata'
26
-
27
25
 
28
- #####
29
- ## more
30
- require_relative 'fifadat/pp/norm'
31
-
32
- require_relative 'fifadat/pp/stages'
33
- require_relative 'fifadat/pp/teams'
34
- require_relative 'fifadat/pp/stadiums'
35
- require_relative 'fifadat/pp/players'
36
-
37
- require_relative 'fifadat/pp/officials' ## aka referees
38
- require_relative 'fifadat/pp/goals'
39
- require_relative 'fifadat/pp/goals-calc_score'
40
- require_relative 'fifadat/pp/penalties'
41
- require_relative 'fifadat/pp/substitutions'
42
-
43
-
44
- require_relative 'fifadat/pp/build_match'
45
- require_relative 'fifadat/pp/build_report'
46
- require_relative 'fifadat/pp/convert'
47
- require_relative 'fifadat/pp/convert-reports'
48
-
49
- require_relative 'fifadat/pp/helper-date'
50
- require_relative 'fifadat/pp/helper-score'
51
- require_relative 'fifadat/pp/helper-minute'
26
+ require_relative 'fifadat/prepare' ## "all-in-one" prepare (download cache) helpers etc.
52
27
 
53
28
 
54
- require_relative 'fifadat/tool' ## fifadat command-line tool
29
+ puts Fifadat.banner ## say hello
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: fifadat
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.0.1
4
+ version: 2026.9.30
5
5
  platform: ruby
6
6
  authors:
7
7
  - Gerald Bauer
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2026-07-22 00:00:00.000000000 Z
11
+ date: 2026-09-30 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: cocos
@@ -88,8 +88,7 @@ dependencies:
88
88
  version: '4.2'
89
89
  description: fifadat - get football data via the (unofficial) fifa api
90
90
  email: gerald.bauer@gmail.com
91
- executables:
92
- - fifadat
91
+ executables: []
93
92
  extensions: []
94
93
  extra_rdoc_files:
95
94
  - CHANGELOG.md
@@ -100,93 +99,75 @@ files:
100
99
  - Manifest.txt
101
100
  - README.md
102
101
  - Rakefile
103
- - bin/fifadat
102
+ - config/codes_club-europe.csv
103
+ - config/codes_club.csv
104
+ - config/codes_nati.csv
105
+ - config/seasons/ar.csv
106
+ - config/seasons/at.csv
107
+ - config/seasons/at.cup.csv
108
+ - config/seasons/au.csv
109
+ - config/seasons/be.csv
110
+ - config/seasons/br.csv
111
+ - config/seasons/ch.csv
112
+ - config/seasons/clubworldcup.csv
113
+ - config/seasons/cn.csv
114
+ - config/seasons/co.csv
115
+ - config/seasons/copa.l.csv
116
+ - config/seasons/copa.s.csv
117
+ - config/seasons/cz.csv
118
+ - config/seasons/de.2.csv
119
+ - config/seasons/de.csv
120
+ - config/seasons/de.cup.csv
121
+ - config/seasons/eg.csv
122
+ - config/seasons/eng.2.csv
123
+ - config/seasons/eng.csv
124
+ - config/seasons/eng.facup.csv
125
+ - config/seasons/es.csv
126
+ - config/seasons/fr.csv
127
+ - config/seasons/gr.csv
128
+ - config/seasons/hu.csv
129
+ - config/seasons/ie.csv
130
+ - config/seasons/il.csv
131
+ - config/seasons/interconticup.csv
132
+ - config/seasons/is.csv
133
+ - config/seasons/it.csv
134
+ - config/seasons/it.cup.csv
135
+ - config/seasons/jp.csv
136
+ - config/seasons/kr.csv
137
+ - config/seasons/lu.csv
138
+ - config/seasons/ma.csv
139
+ - config/seasons/mls.csv
140
+ - config/seasons/mx.2.csv
141
+ - config/seasons/mx.csv
142
+ - config/seasons/mx.cup.csv
143
+ - config/seasons/nir.csv
144
+ - config/seasons/nl.csv
145
+ - config/seasons/no.csv
146
+ - config/seasons/pl.csv
147
+ - config/seasons/pt.csv
148
+ - config/seasons/sa.csv
149
+ - config/seasons/sco.csv
150
+ - config/seasons/se.csv
151
+ - config/seasons/tn.csv
152
+ - config/seasons/tr.csv
153
+ - config/seasons/uefa.cl.csv
154
+ - config/seasons/uefa.con.csv
155
+ - config/seasons/uefa.europa.csv
156
+ - config/seasons/uy.csv
157
+ - config/seasons/wal.csv
158
+ - config/seasons/worldcup.csv
159
+ - config/seasons/za.csv
104
160
  - lib/fifadat.rb
105
- - lib/fifadat/api-config.rb
106
161
  - lib/fifadat/api.rb
107
- - lib/fifadat/config/codes_club-europe.csv
108
- - lib/fifadat/config/codes_club.csv
109
- - lib/fifadat/config/codes_nati.csv
110
- - lib/fifadat/config/seasons/ar.csv
111
- - lib/fifadat/config/seasons/at.csv
112
- - lib/fifadat/config/seasons/at.cup.csv
113
- - lib/fifadat/config/seasons/au.csv
114
- - lib/fifadat/config/seasons/be.csv
115
- - lib/fifadat/config/seasons/br.csv
116
- - lib/fifadat/config/seasons/ch.csv
117
- - lib/fifadat/config/seasons/clubworldcup.csv
118
- - lib/fifadat/config/seasons/cn.csv
119
- - lib/fifadat/config/seasons/co.csv
120
- - lib/fifadat/config/seasons/copa.l.csv
121
- - lib/fifadat/config/seasons/copa.s.csv
122
- - lib/fifadat/config/seasons/cz.csv
123
- - lib/fifadat/config/seasons/de.2.csv
124
- - lib/fifadat/config/seasons/de.csv
125
- - lib/fifadat/config/seasons/de.cup.csv
126
- - lib/fifadat/config/seasons/eg.csv
127
- - lib/fifadat/config/seasons/eng.2.csv
128
- - lib/fifadat/config/seasons/eng.csv
129
- - lib/fifadat/config/seasons/eng.facup.csv
130
- - lib/fifadat/config/seasons/es.csv
131
- - lib/fifadat/config/seasons/fr.csv
132
- - lib/fifadat/config/seasons/gr.csv
133
- - lib/fifadat/config/seasons/hu.csv
134
- - lib/fifadat/config/seasons/ie.csv
135
- - lib/fifadat/config/seasons/il.csv
136
- - lib/fifadat/config/seasons/interconticup.csv
137
- - lib/fifadat/config/seasons/is.csv
138
- - lib/fifadat/config/seasons/it.csv
139
- - lib/fifadat/config/seasons/it.cup.csv
140
- - lib/fifadat/config/seasons/jp.csv
141
- - lib/fifadat/config/seasons/kr.csv
142
- - lib/fifadat/config/seasons/lu.csv
143
- - lib/fifadat/config/seasons/ma.csv
144
- - lib/fifadat/config/seasons/mls.csv
145
- - lib/fifadat/config/seasons/mx.2.csv
146
- - lib/fifadat/config/seasons/mx.csv
147
- - lib/fifadat/config/seasons/mx.cup.csv
148
- - lib/fifadat/config/seasons/nir.csv
149
- - lib/fifadat/config/seasons/nl.csv
150
- - lib/fifadat/config/seasons/no.csv
151
- - lib/fifadat/config/seasons/pl.csv
152
- - lib/fifadat/config/seasons/pt.csv
153
- - lib/fifadat/config/seasons/sa.csv
154
- - lib/fifadat/config/seasons/sco.csv
155
- - lib/fifadat/config/seasons/se.csv
156
- - lib/fifadat/config/seasons/tn.csv
157
- - lib/fifadat/config/seasons/tr.csv
158
- - lib/fifadat/config/seasons/uefa.cl.csv
159
- - lib/fifadat/config/seasons/uefa.con.csv
160
- - lib/fifadat/config/seasons/uefa.europa.csv
161
- - lib/fifadat/config/seasons/uy.csv
162
- - lib/fifadat/config/seasons/wal.csv
163
- - lib/fifadat/config/seasons/worldcup.csv
164
- - lib/fifadat/config/seasons/za.csv
165
- - lib/fifadat/errata.rb
162
+ - lib/fifadat/config.rb
166
163
  - lib/fifadat/helper.rb
167
164
  - lib/fifadat/json.rb
168
- - lib/fifadat/pp/build_match.rb
169
- - lib/fifadat/pp/build_report.rb
170
- - lib/fifadat/pp/convert-reports.rb
171
- - lib/fifadat/pp/convert.rb
172
- - lib/fifadat/pp/goals-calc_score.rb
173
- - lib/fifadat/pp/goals.rb
174
- - lib/fifadat/pp/helper-date.rb
175
- - lib/fifadat/pp/helper-minute.rb
176
- - lib/fifadat/pp/helper-score.rb
177
- - lib/fifadat/pp/norm.rb
178
- - lib/fifadat/pp/officials.rb
179
- - lib/fifadat/pp/penalties.rb
180
- - lib/fifadat/pp/players.rb
181
- - lib/fifadat/pp/stadiums.rb
182
- - lib/fifadat/pp/stages.rb
183
- - lib/fifadat/pp/substitutions.rb
184
- - lib/fifadat/pp/teams.rb
185
- - lib/fifadat/ppdebug.rb
186
- - lib/fifadat/ppmatch.rb
165
+ - lib/fifadat/pp/ppdebug.rb
166
+ - lib/fifadat/pp/ppmatch.rb
167
+ - lib/fifadat/pp/ppstats.rb
187
168
  - lib/fifadat/prepare.rb
188
- - lib/fifadat/tool.rb
189
169
  - lib/fifadat/types.rb
170
+ - lib/fifadat/version.rb
190
171
  homepage: https://github.com/sportdb/sport.db
191
172
  licenses:
192
173
  - Public Domain
data/bin/fifadat DELETED
@@ -1,14 +0,0 @@
1
- #!/usr/bin/env ruby
2
-
3
- ## tip: to test run:
4
- ## ruby -I ./lib bin/fifadat
5
-
6
-
7
- ##
8
- ## note - always use latest (local) if present
9
- $LOAD_PATH.unshift( '/sports/yorobot/sport.db.more/fifadat/lib' )
10
-
11
- require 'fifadat'
12
-
13
-
14
- Fifadat.main( ARGV )