embulk-parser-flexml 0.0.2 → 0.1.0
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/README.md +51 -1
- data/embulk-parser-flexml.gemspec +1 -1
- data/lib/embulk/parser/flexml.rb +0 -2
- metadata +1 -1
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 92b62579f82c0e76101654aba869f42f3dabb546
|
4
|
+
data.tar.gz: 2cba4b0dc538c36e78cf4cb7e8f45de6e3047b95
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: dfb6e1db63ef4e6429609b7403e7797aa151ad69a254e36bd5594c30f677ac62dbff0bd47cc382326dd02a76fe92a25b4c141f3bb2f89445a7b187494ad7093d
|
7
|
+
data.tar.gz: df0d9014a134998a1daa214232cb5d609441ea01dbd8bfe2eb07e8a0bc45bdfd6096c8808c70bb921fd92f454f534070bf3f6749bfe351a56a80f0b64cb7baaa
|
data/README.md
CHANGED
@@ -1,2 +1,52 @@
|
|
1
1
|
# embulk-parser-flexml
|
2
|
-
|
2
|
+
|
3
|
+
Parser plugin for [Embulk](https://github.com/embulk/embulk).
|
4
|
+
|
5
|
+
Flexible xml parser for embulk. read data using xpath and from attributes
|
6
|
+
|
7
|
+
* **Plugin type**: parser
|
8
|
+
* **Load all or nothing**: yes
|
9
|
+
* **Resume supported**: no
|
10
|
+
|
11
|
+
## Configuration
|
12
|
+
|
13
|
+
- **type**: specify this plugin as `flexml` .
|
14
|
+
- **root**: root property to start fetching each entries, specify in *path/to/node* style (string, required)
|
15
|
+
- **schema**: specify the attribute of table and data type (required)
|
16
|
+
- **name**: name of the attribute (string, required)
|
17
|
+
- **type**: type of the attribute (string, required)
|
18
|
+
- **attribute**: if specified, value of this attribute will be the output, otherwise child will be the output (string, optional)
|
19
|
+
- **xpath**: child element to select (string, required)
|
20
|
+
|
21
|
+
## Example
|
22
|
+
|
23
|
+
### Configuration
|
24
|
+
|
25
|
+
```yaml
|
26
|
+
parser:
|
27
|
+
type: flexml
|
28
|
+
root: Team/Players/Player
|
29
|
+
schema:
|
30
|
+
- { name: name, type: string, attribute: name }
|
31
|
+
- { name: age, type: long, attribute: age }
|
32
|
+
- { name: about, type: string, xpath: About }
|
33
|
+
- { name: facebook, type: string, xpath: "SocialMedia[@type='facebook']", attribute: url }
|
34
|
+
- { name: twitter, type: string, xpath: "SocialMedia[@type='twitter']", attribute: url }
|
35
|
+
```
|
36
|
+
|
37
|
+
### XML
|
38
|
+
|
39
|
+
```xml
|
40
|
+
<?xml version="1.0" encoding="utf-8" standalone="no"?>
|
41
|
+
<Team>
|
42
|
+
<Players>
|
43
|
+
<Player name="Locatelli" age="23">
|
44
|
+
<About>
|
45
|
+
Manuel Locatelli Cavaliere OMRI (born 8 January 1998) is an Italian professional footballer who plays as a midfielder for Serie A club Juventus, on loan from Serie A club Sassuolo, and the Italy national team.
|
46
|
+
</About>
|
47
|
+
<SocialMedia type="facebook" url="https://www.facebook.com/locamanuel73"/>
|
48
|
+
<SocialMedia type="twitter" url="https://twitter.com/locamanuel73"/>
|
49
|
+
</Player>
|
50
|
+
</Players>
|
51
|
+
</Team>
|
52
|
+
```
|
@@ -3,7 +3,7 @@ $LOAD_PATH.unshift(lib) unless $LOAD_PATH.include?(lib)
|
|
3
3
|
|
4
4
|
Gem::Specification.new do |spec|
|
5
5
|
spec.name = "embulk-parser-flexml"
|
6
|
-
spec.version = "0.0
|
6
|
+
spec.version = "0.1.0"
|
7
7
|
spec.authors = ["Surya Asriadie"]
|
8
8
|
spec.email = ["surya.asriadie@gmail.com"]
|
9
9
|
spec.summary = %q{Flexible Embulk parser plugin for XML}
|
data/lib/embulk/parser/flexml.rb
CHANGED