football-cat 0.0.1 → 0.1.0

Sign up to get free protection for your applications and to get access to all the features.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA1:
3
- metadata.gz: b99f5753f1c440b0c2bce4c18965ed07b37bc193
4
- data.tar.gz: db8bf5223f6e5e42de9f610fcb5812e45c87e65f
3
+ metadata.gz: 5f049230d455d5f193ef47130fc8fceb5c24f170
4
+ data.tar.gz: b03a2d436aec95aa8bac7f02f36b2e35aee4336b
5
5
  SHA512:
6
- metadata.gz: c4fdddaebd05f0df7bfae509c2ace78374888f421fa1aac68b815e1a6830cc7c815e1b4438c7ee1926cccfe805e8dee1f1355a99b1f979a959795ecea13bec6f
7
- data.tar.gz: 063de7fe1f277d2f968a17b16bc5f83c9455fe956d88f96403d21079355fb4867bb0bc65c526137241a3ba573a2da0ddf0fc0efd3b2de8325f3de716aa73cf81
6
+ metadata.gz: c96ad2a9b2516d1c44ea872ac8f43ff7135a7591009d7e4aebe7c1077a6f367551ef893d11b6f01f4dea9fefe23b8ca44db4b2010b297c333d3891f73a66c9ce
7
+ data.tar.gz: b99f5b5e26dcdf52c00aebc345166e01f85ea256976a0f9d0bc7488db2a4d8c62fba5d0d33ed85e00bf9173e21c0e4f556a175ddb6f3aa7c3303d80500f3b610
data/README.md CHANGED
@@ -1,4 +1,4 @@
1
- # football-cat - concatenate football.csv datafiles
1
+ # football-cat - concatenate football.csv datafiles - make out of many, one
2
2
 
3
3
 
4
4
  * home :: [github.com/sportdb/football.db](https://github.com/sportdb/football.db)
@@ -11,6 +11,103 @@
11
11
 
12
12
  ## Usage
13
13
 
14
+ Run this tool to concatenate match files (for football clubs or national teams) in the one-line, one-match & one-file, one-season Football.CSV format
15
+ into one
16
+ PLUS (auto-)adding the missing league and season headers / columns
17
+ inferred from the file's basename (e.g. `es.1.csv` => `ES1`)
18
+ and the file's directory (e.g. `/2020-21/` => `2020/21`). Example:
19
+
20
+ ```
21
+ $ football-cat espana.csv espana
22
+ ```
23
+
24
+ Concatenates all match files in the `espana` directory
25
+ (and all its subdirectories) into the single-file `espana.csv`
26
+ plus (auto-)adding two new leading columns, that is, league and season.
27
+
28
+ ```
29
+ /footballcsv/espana
30
+ ├───2010s
31
+ │ ├───2012-13
32
+ │ │ es.1.csv
33
+ │ ├───2013-14
34
+ │ │ es.1.csv
35
+ │ ├───2014-15
36
+ │ │ es.1.csv
37
+ │ ├───2015-16
38
+ │ │ es.1.csv
39
+ │ ├───2016-17
40
+ │ │ es.1.csv
41
+ │ ├───2017-18
42
+ │ │ es.1.csv
43
+ │ ├───2018-19
44
+ │ │ es.1.csv
45
+ │ │ es.2.csv
46
+ │ └───2019-20
47
+ │ es.1.csv
48
+ │ es.2.csv
49
+ └───2020s
50
+ └───2020-21
51
+ es.1.csv
52
+ es.2.csv
53
+ ```
54
+
55
+ and looking into `2010s/2012-12/es.1.csv`, for example:
56
+
57
+ ```
58
+ Round,Date,Team 1,FT,Team 2
59
+ 1,Sat Aug 18 2012,RCD Mallorca,2-1,RCD Espanyol
60
+ 1,Sat Aug 18 2012,Sevilla FC,2-1,Getafe CF
61
+ 1,Sat Aug 18 2012,RC Celta Vigo,0-1,Málaga CF
62
+ 1,Sun Aug 19 2012,Levante UD,1-1,Atlético Madrid
63
+ 1,Sun Aug 19 2012,Real Madrid,1-1,Valencia CF
64
+ 1,Sun Aug 19 2012,FC Barcelona,5-1,Real Sociedad
65
+ 1,Sun Aug 19 2012,Athletic Club Bilbao,3-5,Real Betis
66
+ 1,Mon Aug 20 2012,RCD La Coruña,2-0,CA Osasuna
67
+ 1,Mon Aug 20 2012,Rayo Vallecano,1-0,Granada CF
68
+ 1,Mon Aug 20 2012,Real Zaragoza,0-1,Real Valladolid CF
69
+ ```
70
+
71
+ becomes the all-in-one `espana.csv`:
72
+
73
+ ```
74
+ League,Season,Round,Date,Team 1,FT,Team 2
75
+ ES1,2012/13,1,Sat Aug 18 2012,RCD Mallorca,2-1,RCD Espanyol
76
+ ES1,2012/13,1,Sat Aug 18 2012,Sevilla FC,2-1,Getafe CF
77
+ ES1,2012/13,1,Sat Aug 18 2012,RC Celta Vigo,0-1,Málaga CF
78
+ ES1,2012/13,1,Sun Aug 19 2012,Levante UD,1-1,Atlético Madrid
79
+ ES1,2012/13,1,Sun Aug 19 2012,Real Madrid,1-1,Valencia CF
80
+ ES1,2012/13,1,Sun Aug 19 2012,FC Barcelona,5-1,Real Sociedad
81
+ ES1,2012/13,1,Sun Aug 19 2012,Athletic Club Bilbao,3-5,Real Betis
82
+ ES1,2012/13,1,Mon Aug 20 2012,RCD La Coruña,2-0,CA Osasuna
83
+ ES1,2012/13,1,Mon Aug 20 2012,Rayo Vallecano,1-0,Granada CF
84
+ ES1,2012/13,1,Mon Aug 20 2012,Real Zaragoza,0-1,Real Valladolid CF
85
+ ...
86
+ ES2,2020/21,42,Sun May 30 2021,AD Alcorcón,,RCD Espanyol
87
+ ES2,2020/21,42,Sun May 30 2021,Albacete Balompié,,CF Fuenlabrada
88
+ ES2,2020/21,42,Sun May 30 2021,CD Mirandés,,CE Sabadell
89
+ ES2,2020/21,42,Sun May 30 2021,CD Tenerife,,Real Oviedo
90
+ ES2,2020/21,42,Sun May 30 2021,FC Cartagena,,Girona FC
91
+ ES2,2020/21,42,Sun May 30 2021,Málaga CF,,CD Castellón
92
+ ES2,2020/21,42,Sun May 30 2021,Rayo Vallecano,,CD Lugo
93
+ ES2,2020/21,42,Sun May 30 2021,Real Zaragoza,,CD Leganés
94
+ ES2,2020/21,42,Sun May 30 2021,SD Ponferradina,,RCD Mallorca
95
+ ES2,2020/21,42,Sun May 30 2021,Sporting Gijón,,UD Almería
96
+ ES2,2020/21,42,Sun May 30 2021,UD Logroñés,,UD Las Palmas
97
+ ```
98
+
99
+
100
+ Note: You can pass along more than one directory to the tool.
101
+ Let's concatenate the top leagues from the football.csv org:
102
+
103
+ ```
104
+ $ football-cat top.csv footballcsv/england \
105
+ footballcsv/espana \
106
+ footballcsv/deutschland
107
+ ```
108
+
109
+
110
+ That's all for now. Happy data wrangling. Enjoy the beautiful game.
14
111
 
15
112
 
16
113
  ## Datasets
data/Rakefile CHANGED
@@ -6,7 +6,7 @@ Hoe.spec 'football-cat' do
6
6
 
7
7
  self.version = SportDb::Module::FootballCat::VERSION
8
8
 
9
- self.summary = 'football-cat - concatenate football.csv datafiles'
9
+ self.summary = 'football-cat - concatenate football.csv datafiles - make out of many, one'
10
10
  self.description = summary
11
11
 
12
12
  self.urls = { home: 'https://github.com/sportdb/football.db'}
@@ -3,18 +3,11 @@ require 'optparse'
3
3
 
4
4
  require 'sportdb/catalogs'
5
5
 
6
+
6
7
  ###
7
8
  # our own code
8
9
  require 'football-cat/version' # let version always go first
9
-
10
-
11
- module FootballCat
12
- class Tool
13
-
14
- end # class Tool
15
-
16
- def self.main( args=ARGV ) Tool.new.run( args ); end
17
- end # module FootballCat
10
+ require 'football-cat/tool'
18
11
 
19
12
 
20
13
 
@@ -3,8 +3,8 @@ module Module
3
3
  module FootballCat
4
4
 
5
5
  MAJOR = 0 ## todo: namespace inside version or something - why? why not??
6
- MINOR = 0
7
- PATCH = 1
6
+ MINOR = 1
7
+ PATCH = 0
8
8
  VERSION = [MAJOR,MINOR,PATCH].join('.')
9
9
 
10
10
  def self.version
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: football-cat
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.0.1
4
+ version: 0.1.0
5
5
  platform: ruby
6
6
  authors:
7
7
  - Gerald Bauer
@@ -58,7 +58,8 @@ dependencies:
58
58
  - - "~>"
59
59
  - !ruby/object:Gem::Version
60
60
  version: '3.22'
61
- description: football-cat - concatenate football.csv datafiles
61
+ description: football-cat - concatenate football.csv datafiles - make out of many,
62
+ one
62
63
  email: opensport@googlegroups.com
63
64
  executables:
64
65
  - football-cat
@@ -102,5 +103,5 @@ rubyforge_project:
102
103
  rubygems_version: 2.5.2
103
104
  signing_key:
104
105
  specification_version: 4
105
- summary: football-cat - concatenate football.csv datafiles
106
+ summary: football-cat - concatenate football.csv datafiles - make out of many, one
106
107
  test_files: []