embulk-filter-csv_lookup 0.1.3 → 0.1.4

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.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: 8ccafa3bb3b3f1e20a20057215519b154ca294c269d1f074df4dad20decb9a6f
4
- data.tar.gz: b61c6f909b4530b674ba4b368407ec10c95ec58411c1d20bc34af08ed805254c
3
+ metadata.gz: ea887d2eca661811bc1154692e5fca0e1274232d97a44d42699a6137966465ff
4
+ data.tar.gz: a3d959af31a34afe64e48860435c37f72ff07c2d8d7ca15fb2cc3eac28e2164f
5
5
  SHA512:
6
- metadata.gz: 36a7d0d51e645b3f36f2e8ddb5a8e1d28644a35dd694041c915ed9752f061fcf1cbff824faeeecc88d09fc8a1549df45f9488be624006a8cecf424e6e4e45576
7
- data.tar.gz: d8bda98b5b26da4ef42c2f87b2e973536c55ce3fdcf2282f081548ce532019051ab54a61c2d7fcbb99866c18b078736c53c94c19fe560c395a85f766353d346e
6
+ metadata.gz: 716fec4d87a5c991cee0851f77c5cd7df7bb070253a9911d58fb129356b45249501e10b8f70de5af1518c69b38a84c39fea957c96bc3864fd9f737d13004ba79
7
+ data.tar.gz: b4346c7930bb78ce71a093116e41566620f780d4e60a2a03767c2af677673c919a1fe59f243ab242aaab5216c15937001b4029c3119da486f950aa281f0b6719
data/.gitignore CHANGED
@@ -1,12 +1,12 @@
1
- *~
2
- /pkg/
3
- /tmp/
4
- *.gemspec
5
- .gradle/
6
- /classpath/
7
- build/
8
- .idea
9
- /.settings/
10
- /.metadata/
11
- .classpath
12
- .project
1
+ *~
2
+ /pkg/
3
+ /tmp/
4
+ *.gemspec
5
+ .gradle/
6
+ /classpath/
7
+ build/
8
+ .idea
9
+ /.settings/
10
+ /.metadata/
11
+ .classpath
12
+ .project
data/LICENSE CHANGED
@@ -1,21 +1,21 @@
1
- MIT License
2
-
3
- Copyright (c) 2022 InfoObjects Inc.
4
-
5
- Permission is hereby granted, free of charge, to any person obtaining a copy
6
- of this software and associated documentation files (the "Software"), to deal
7
- in the Software without restriction, including without limitation the rights
8
- to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
9
- copies of the Software, and to permit persons to whom the Software is
10
- furnished to do so, subject to the following conditions:
11
-
12
- The above copyright notice and this permission notice shall be included in all
13
- copies or substantial portions of the Software.
14
-
15
- THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
16
- IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
17
- FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
18
- AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
19
- LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
20
- OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
1
+ MIT License
2
+
3
+ Copyright (c) 2022 InfoObjects Inc.
4
+
5
+ Permission is hereby granted, free of charge, to any person obtaining a copy
6
+ of this software and associated documentation files (the "Software"), to deal
7
+ in the Software without restriction, including without limitation the rights
8
+ to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
9
+ copies of the Software, and to permit persons to whom the Software is
10
+ furnished to do so, subject to the following conditions:
11
+
12
+ The above copyright notice and this permission notice shall be included in all
13
+ copies or substantial portions of the Software.
14
+
15
+ THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
16
+ IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
17
+ FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
18
+ AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
19
+ LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
20
+ OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
21
21
  SOFTWARE.
data/README.md CHANGED
@@ -1,131 +1,131 @@
1
- <p align="center">
2
- <a href="https://www.infoobjects.com/" target="blank"><img src="screenshots/logo.png" width="150" alt="InfoObjects Logo" /></a>
3
- </p>
4
- <p align="center">Infoobjects is a consulting company that helps enterprises transform how and where they run applications and infrastructure.
5
- From strategy, to implementation, to ongoing managed services, Infoobjects creates tailored cloud solutions for enterprises at all stages of the cloud journey.</p>
6
-
7
-
8
- # CSV lookup filter plugin for Embulk
9
- [![license](https://img.shields.io/badge/license-MIT-blue.svg)](LICENSE)
10
-
11
- An Embulk filter plugin for Lookup Transformation with CSV
12
-
13
- ## Configuration
14
-
15
- - **csv_lookup**: Required attributes for the LookUp Filter Plugin -
16
- - **filters**:
17
- - **type**: Name of lookup type (required)
18
- - **mapping_from**: (Name of columns to be matched with table 2 columns) (required)
19
- - **Name of column-1**: column name-1 from input file
20
- - **Name of column-2**: column name-2 from input file etc ...
21
- - **mapping_to**: (Name of columns to be matched with table 1 columns) (required)
22
- - **Name of column-1**: column name-1 from input file
23
- - **Name of column-2**: column name-2 from input file
24
- - **new_columns**: (New generated column names) (required)
25
- - **Name-1,Type-1**: Any Name, Type of the name (name: country_name, type: string)
26
- - **Name-2,Type-2**: Any Name, Type of the name (name: country_address, type: string) etc ...
27
- - **path_of_lookup_file**: lookup file path (required)
28
- ## Example - columns
29
-
30
- Input1 for table 1 is as follows :-
31
-
32
- ```
33
- year country_code country_name literacy_rate
34
-
35
- 1990 1 India 80%
36
- 1993 2 USA 83%
37
- 1997 3 JAPAN
38
- 1999 4 China 72%
39
- 2000 5 Ukraine 68%
40
- 2002 6 Italy 79%
41
- 2004 7 UK 75%
42
- 2011 8 NULL 42%
43
- ```
44
-
45
- Input2 for table 2 is as follows :-
46
-
47
- ```
48
- id country_population country_address country_GDP
49
-
50
- 1 11.3 India 1.67
51
- 2 18.2 USA 16.72
52
- 3 30 JAPAN 5.00
53
- 4 4 China 9.33
54
- 5 57 Ukraine 1.08
55
- 6 63 Italy 2.068
56
- 7 17 UK 2.49
57
- 8 28 UAE 1.18
58
-
59
-
60
- Note: country_population is calculated in Billion and country_GDP is calculated in $USD Trillion
61
- ```
62
-
63
- As shown in yaml below, columns mentioned in mapping_from will be mapped with columns mentioned in mapping_to
64
- ie:
65
-
66
-
67
- country_code : id
68
- country_name : country_address
69
-
70
- After successful mapping an Output.csv file containing the columns mentioned in new_columns will be generated
71
-
72
- Output File generated :-
73
-
74
- ```
75
- year country_code country_name literacy_rate country_GDP country_population
76
-
77
- 1990 1 India 80% 1.67 11.3
78
- 1993 2 USA 83% 16.72 18.2
79
- 1997 3 JAPAN 5.00 30
80
- 1999 4 China 72% 9.33 4
81
- 2000 5 Ukraine 68% 1.08 57
82
- 2002 6 Italy 79% 2.068 63
83
- 2004 7 UK 75% 2.49 17
84
- 2011 8 NULL 42%
85
- ```
86
-
87
- ```yaml
88
- - type: csv_lookup
89
- mapping_from:
90
- - country_code
91
- - country_name
92
- mapping_to:
93
- - id
94
- - country_address
95
- new_columns:
96
- - { name: country_GDP, type: string }
97
- - { name: country_population, type: string }
98
- ```
99
-
100
- Notes:
101
- 1. mapping_from attribute should be in same order as mentioned in input file.
102
-
103
- ## Development
104
-
105
- Run example:
106
-
107
- ```
108
- $ ./gradlew package
109
- $ embulk run -I ./lib seed.yml
110
- ```
111
-
112
- Deployment Steps:
113
-
114
- ```
115
- Install ruby in your machine
116
- $ gem install gemcutter (For windows OS)
117
-
118
- $ ./gradlew gemPush
119
- $ gem build NameOfYourPlugins (example: embulk-filter-csv_lookup)
120
- $ gem push embulk-filter-csv_lookup-0.1.0.gem (You will get this name after running above command)
121
- ```
122
-
123
- Release gem:
124
-
125
- ```
126
- $ ./gradlew gemPush
127
- ```
128
-
129
- ## Licensing
130
-
131
- InfoObjects [license](LICENSE) (MIT License)
1
+ <p align="center">
2
+ <a href="https://www.infoobjects.com/" target="blank"><img src="screenshots/logo.png" width="150" alt="InfoObjects Logo" /></a>
3
+ </p>
4
+ <p align="center">Infoobjects is a consulting company that helps enterprises transform how and where they run applications and infrastructure.
5
+ From strategy, to implementation, to ongoing managed services, Infoobjects creates tailored cloud solutions for enterprises at all stages of the cloud journey.</p>
6
+
7
+
8
+ # CSV lookup filter plugin for Embulk
9
+ [![license](https://img.shields.io/badge/license-MIT-blue.svg)](LICENSE)
10
+
11
+ An Embulk filter plugin for Lookup Transformation with CSV
12
+
13
+ ## Configuration
14
+
15
+ - **csv_lookup**: Required attributes for the LookUp Filter Plugin -
16
+ - **filters**:
17
+ - **type**: Name of lookup type (required)
18
+ - **mapping_from**: (Name of columns to be matched with table 2 columns) (required)
19
+ - **Name of column-1**: column name-1 from input file
20
+ - **Name of column-2**: column name-2 from input file etc ...
21
+ - **mapping_to**: (Name of columns to be matched with table 1 columns) (required)
22
+ - **Name of column-1**: column name-1 from input file
23
+ - **Name of column-2**: column name-2 from input file
24
+ - **new_columns**: (New generated column names) (required)
25
+ - **Name-1,Type-1**: Any Name, Type of the name (name: country_name, type: string)
26
+ - **Name-2,Type-2**: Any Name, Type of the name (name: country_address, type: string) etc ...
27
+ - **path_of_lookup_file**: lookup file path (required)
28
+ ## Example - columns
29
+
30
+ Input1 for table 1 is as follows :-
31
+
32
+ ```
33
+ year country_code country_name literacy_rate
34
+
35
+ 1990 1 India 80%
36
+ 1993 2 USA 83%
37
+ 1997 3 JAPAN
38
+ 1999 4 China 72%
39
+ 2000 5 Ukraine 68%
40
+ 2002 6 Italy 79%
41
+ 2004 7 UK 75%
42
+ 2011 8 NULL 42%
43
+ ```
44
+
45
+ Input2 for table 2 is as follows :-
46
+
47
+ ```
48
+ id country_population country_address country_GDP
49
+
50
+ 1 11.3 India 1.67
51
+ 2 18.2 USA 16.72
52
+ 3 30 JAPAN 5.00
53
+ 4 4 China 9.33
54
+ 5 57 Ukraine 1.08
55
+ 6 63 Italy 2.068
56
+ 7 17 UK 2.49
57
+ 8 28 UAE 1.18
58
+
59
+
60
+ Note: country_population is calculated in Billion and country_GDP is calculated in $USD Trillion
61
+ ```
62
+
63
+ As shown in yaml below, columns mentioned in mapping_from will be mapped with columns mentioned in mapping_to
64
+ ie:
65
+
66
+
67
+ country_code : id
68
+ country_name : country_address
69
+
70
+ After successful mapping an Output.csv file containing the columns mentioned in new_columns will be generated
71
+
72
+ Output File generated :-
73
+
74
+ ```
75
+ year country_code country_name literacy_rate country_GDP country_population
76
+
77
+ 1990 1 India 80% 1.67 11.3
78
+ 1993 2 USA 83% 16.72 18.2
79
+ 1997 3 JAPAN 5.00 30
80
+ 1999 4 China 72% 9.33 4
81
+ 2000 5 Ukraine 68% 1.08 57
82
+ 2002 6 Italy 79% 2.068 63
83
+ 2004 7 UK 75% 2.49 17
84
+ 2011 8 NULL 42%
85
+ ```
86
+
87
+ ```yaml
88
+ - type: csv_lookup
89
+ mapping_from:
90
+ - country_code
91
+ - country_name
92
+ mapping_to:
93
+ - id
94
+ - country_address
95
+ new_columns:
96
+ - { name: country_GDP, type: string }
97
+ - { name: country_population, type: string }
98
+ ```
99
+
100
+ Notes:
101
+ 1. mapping_from attribute should be in same order as mentioned in input file.
102
+
103
+ ## Development
104
+
105
+ Run example:
106
+
107
+ ```
108
+ $ ./gradlew package
109
+ $ embulk run -I ./lib seed.yml
110
+ ```
111
+
112
+ Deployment Steps:
113
+
114
+ ```
115
+ Install ruby in your machine
116
+ $ gem install gemcutter (For windows OS)
117
+
118
+ $ ./gradlew gemPush
119
+ $ gem build NameOfYourPlugins (example: embulk-filter-csv_lookup)
120
+ $ gem push embulk-filter-csv_lookup-0.1.0.gem (You will get this name after running above command)
121
+ ```
122
+
123
+ Release gem:
124
+
125
+ ```
126
+ $ ./gradlew gemPush
127
+ ```
128
+
129
+ ## Licensing
130
+
131
+ InfoObjects [license](LICENSE) (MIT License)
data/build.gradle CHANGED
@@ -1,98 +1,98 @@
1
- plugins {
2
- id "com.jfrog.bintray" version "1.1"
3
- id "com.github.jruby-gradle.base" version "1.5.0"
4
- id "java"
5
- id "checkstyle"
6
- }
7
- import com.github.jrubygradle.JRubyExec
8
- repositories {
9
- mavenCentral()
10
- jcenter()
11
- }
12
- configurations {
13
- provided
14
- }
15
-
16
- version = "0.1.3"
17
-
18
- sourceCompatibility = 1.8
19
- targetCompatibility = 1.8
20
-
21
- dependencies {
22
- compile 'com.opencsv:opencsv:5.6'
23
- compile "org.embulk:embulk-core:0.9.8"
24
- provided "org.embulk:embulk-core:0.9.8"
25
- // compile "YOUR_JAR_DEPENDENCY_GROUP:YOUR_JAR_DEPENDENCY_MODULE:YOUR_JAR_DEPENDENCY_VERSION"
26
- testCompile "junit:junit:4.+"
27
- }
28
-
29
- task classpath(type: Copy, dependsOn: ["jar"]) {
30
- doFirst { file("classpath").deleteDir() }
31
- from (configurations.runtime - configurations.provided + files(jar.archivePath))
32
- into "classpath"
33
- }
34
- clean { delete "classpath" }
35
-
36
- checkstyle {
37
- configFile = file("${project.rootDir}/config/checkstyle/checkstyle.xml")
38
- toolVersion = '6.14.1'
39
- }
40
- checkstyleMain {
41
- configFile = file("${project.rootDir}/config/checkstyle/default.xml")
42
- ignoreFailures = true
43
- }
44
- checkstyleTest {
45
- configFile = file("${project.rootDir}/config/checkstyle/default.xml")
46
- ignoreFailures = true
47
- }
48
- task checkstyle(type: Checkstyle) {
49
- classpath = sourceSets.main.output + sourceSets.test.output
50
- source = sourceSets.main.allJava + sourceSets.test.allJava
51
- }
52
-
53
- task gem(type: JRubyExec, dependsOn: ["gemspec", "classpath"]) {
54
- jrubyArgs "-S"
55
- script "gem"
56
- scriptArgs "build", "${project.name}.gemspec"
57
- doLast { ant.move(file: "${project.name}-${project.version}.gem", todir: "pkg") }
58
- }
59
-
60
- task gemPush(type: JRubyExec, dependsOn: ["gem"]) {
61
- jrubyArgs "-rrubygems/gem_runner", "-eGem::GemRunner.new.run(ARGV)", "push"
62
- script "pkg/${project.name}-${project.version}.gem"
63
- }
64
-
65
- task "package"(dependsOn: ["gemspec", "classpath"]) {
66
- doLast {
67
- println "> Build succeeded."
68
- println "> You can run embulk with '-L ${file(".").absolutePath}' argument."
69
- }
70
- }
71
-
72
- task gemspec {
73
- ext.gemspecFile = file("${project.name}.gemspec")
74
- inputs.file "build.gradle"
75
- outputs.file gemspecFile
76
- doLast { gemspecFile.write($/
77
- Gem::Specification.new do |spec|
78
- spec.name = "${project.name}"
79
- spec.version = "${project.version}"
80
- spec.authors = ["Infoobjects Inc."]
81
- spec.summary = %[An Embulk filter plugin for Lookup Transformation with CSV]
82
- spec.description = %[Csv Lookup Filter]
83
- spec.email = ["utkarsh@infoobjects.com"]
84
- spec.licenses = ["MIT"]
85
- spec.homepage = "https://github.com/InfoObjects/embulk-filter-csv_lookup"
86
-
87
- spec.files = `git ls-files`.split("\n") + Dir["classpath/*.jar"]
88
- spec.test_files = spec.files.grep(%r"^(test|spec)/")
89
- spec.require_paths = ["lib"]
90
-
91
- #spec.add_dependency 'YOUR_GEM_DEPENDENCY', ['~> YOUR_GEM_DEPENDENCY_VERSION']
92
- spec.add_development_dependency 'bundler', ['~> 1.0']
93
- spec.add_development_dependency 'rake', ['~> 12.0']
94
- end
95
- /$)
96
- }
97
- }
98
- clean { delete "${project.name}.gemspec" }
1
+ plugins {
2
+ id "com.jfrog.bintray" version "1.1"
3
+ id "com.github.jruby-gradle.base" version "1.5.0"
4
+ id "java"
5
+ id "checkstyle"
6
+ }
7
+ import com.github.jrubygradle.JRubyExec
8
+ repositories {
9
+ mavenCentral()
10
+ jcenter()
11
+ }
12
+ configurations {
13
+ provided
14
+ }
15
+
16
+ version = "0.1.4"
17
+
18
+ sourceCompatibility = 1.8
19
+ targetCompatibility = 1.8
20
+
21
+ dependencies {
22
+ compile 'com.opencsv:opencsv:5.6'
23
+ compile "org.embulk:embulk-core:0.9.8"
24
+ provided "org.embulk:embulk-core:0.9.8"
25
+ // compile "YOUR_JAR_DEPENDENCY_GROUP:YOUR_JAR_DEPENDENCY_MODULE:YOUR_JAR_DEPENDENCY_VERSION"
26
+ testCompile "junit:junit:4.+"
27
+ }
28
+
29
+ task classpath(type: Copy, dependsOn: ["jar"]) {
30
+ doFirst { file("classpath").deleteDir() }
31
+ from (configurations.runtime - configurations.provided + files(jar.archivePath))
32
+ into "classpath"
33
+ }
34
+ clean { delete "classpath" }
35
+
36
+ checkstyle {
37
+ configFile = file("${project.rootDir}/config/checkstyle/checkstyle.xml")
38
+ toolVersion = '6.14.1'
39
+ }
40
+ checkstyleMain {
41
+ configFile = file("${project.rootDir}/config/checkstyle/default.xml")
42
+ ignoreFailures = true
43
+ }
44
+ checkstyleTest {
45
+ configFile = file("${project.rootDir}/config/checkstyle/default.xml")
46
+ ignoreFailures = true
47
+ }
48
+ task checkstyle(type: Checkstyle) {
49
+ classpath = sourceSets.main.output + sourceSets.test.output
50
+ source = sourceSets.main.allJava + sourceSets.test.allJava
51
+ }
52
+
53
+ task gem(type: JRubyExec, dependsOn: ["gemspec", "classpath"]) {
54
+ jrubyArgs "-S"
55
+ script "gem"
56
+ scriptArgs "build", "${project.name}.gemspec"
57
+ doLast { ant.move(file: "${project.name}-${project.version}.gem", todir: "pkg") }
58
+ }
59
+
60
+ task gemPush(type: JRubyExec, dependsOn: ["gem"]) {
61
+ jrubyArgs "-rrubygems/gem_runner", "-eGem::GemRunner.new.run(ARGV)", "push"
62
+ script "pkg/${project.name}-${project.version}.gem"
63
+ }
64
+
65
+ task "package"(dependsOn: ["gemspec", "classpath"]) {
66
+ doLast {
67
+ println "> Build succeeded."
68
+ println "> You can run embulk with '-L ${file(".").absolutePath}' argument."
69
+ }
70
+ }
71
+
72
+ task gemspec {
73
+ ext.gemspecFile = file("${project.name}.gemspec")
74
+ inputs.file "build.gradle"
75
+ outputs.file gemspecFile
76
+ doLast { gemspecFile.write($/
77
+ Gem::Specification.new do |spec|
78
+ spec.name = "${project.name}"
79
+ spec.version = "${project.version}"
80
+ spec.authors = ["Infoobjects Inc."]
81
+ spec.summary = %[An Embulk filter plugin for Lookup Transformation with CSV]
82
+ spec.description = %[Csv Lookup Filter]
83
+ spec.email = ["utkarsh@infoobjects.com"]
84
+ spec.licenses = ["MIT"]
85
+ spec.homepage = "https://github.com/InfoObjects/embulk-filter-csv_lookup"
86
+
87
+ spec.files = `git ls-files`.split("\n") + Dir["classpath/*.jar"]
88
+ spec.test_files = spec.files.grep(%r"^(test|spec)/")
89
+ spec.require_paths = ["lib"]
90
+
91
+ #spec.add_dependency 'YOUR_GEM_DEPENDENCY', ['~> YOUR_GEM_DEPENDENCY_VERSION']
92
+ spec.add_development_dependency 'bundler', ['~> 1.0']
93
+ spec.add_development_dependency 'rake', ['~> 12.0']
94
+ end
95
+ /$)
96
+ }
97
+ }
98
+ clean { delete "${project.name}.gemspec" }