File: etl.cfg

package info (click to toggle)
python-stetl 1.2%2Bds-1
  • links: PTS, VCS
  • area: main
  • in suites: buster
  • size: 89,988 kB
  • sloc: python: 5,007; xml: 707; sql: 430; makefile: 155; sh: 50
file content (60 lines) | stat: -rw-r--r-- 1,583 bytes parent folder | download | duplicates (3)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
# Trivial use of convert filter: convert XML DOM (etree_doc) to string and back.

[etl]
chains = input_xml_file|convert_xml_to_string|convert_string_to_xml|output_xml_file,
         input_complex_xml_file|convert_to_json|output_json_file,
         input_gml_sf_file|convert_to_geojson|output_geojson_file

# XML to String and back
[input_xml_file]
class = inputs.fileinput.XmlFileInput
file_path = input/cities.xml

[convert_xml_to_string]
class = filters.formatconverter.FormatConverter
input_format = etree_doc
output_format = string

[convert_string_to_xml]
class = filters.formatconverter.FormatConverter
input_format = string
output_format = etree_doc

[output_xml_file]
class = outputs.fileoutput.FileOutput
file_path = output/cities.xml

# XML to JSON
[input_complex_xml_file]
class = inputs.fileinput.XmlFileInput
file_path = input/building-dutch-bag.xml

[convert_to_json]
class = filters.formatconverter.FormatConverter
input_format = etree_doc
output_format = struct

[output_json_file]
class = outputs.fileoutput.FileOutput
file_path = output/building-dutch.json

# GML to GeoJSON
[input_gml_sf_file]
class = inputs.fileinput.XmlFileInput
file_path = input/cities.gml

# The GML must be a simple features collection
[convert_to_geojson]
class = filters.formatconverter.FormatConverter
input_format = etree_doc
output_format = geojson_collection
converter_args = {
    'root_tag': 'FeatureCollection',
    'feature_tag': 'featureMember',
    'feature_id_attr': 'fid'
    }

[output_geojson_file]
class = outputs.fileoutput.FileOutput
file_path = output/cities-gjson.json