forked from jvalue/made-template
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
d2b3485
commit 9de90fb
Showing
1 changed file
with
88 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,88 @@ | ||
pipeline MowestaPipeline { | ||
|
||
block MowestaExtractor oftype HttpExtractor { | ||
url: "https://www.mowesta.com/data/measure/mowesta-dataset-20221107.zip"; | ||
} | ||
|
||
block ZipArchiveInterpreter oftype ArchiveInterpreter { | ||
archiveType: "zip"; | ||
} | ||
|
||
block MowestaDataFilePicker oftype FilePicker { | ||
path: "/data.csv"; | ||
} | ||
|
||
block MowestaInterpreter oftype TextFileInterpreter{ | ||
} | ||
|
||
block MowestaCSVInterpreter oftype CSVInterpreter { | ||
delimiter: ";"; | ||
} | ||
|
||
block RenameTemperaturCellWriter oftype CellWriter { | ||
at: cell E1; | ||
write: ["Temperatur"]; | ||
} | ||
|
||
block RenameTemperaturBatteryCellWriter oftype CellWriter { | ||
at: cell J1; | ||
write: ["Batterietemperatur"]; | ||
} | ||
|
||
block MowestaTableInterpreter oftype TableInterpreter { | ||
header: true; | ||
columns: [ | ||
"Geraet" oftype ValidGeraetNumber, | ||
"Hersteller" oftype text, | ||
"Model" oftype text, | ||
"Monat" oftype integer, | ||
"Temperatur" oftype decimal, | ||
"Batterietemperatur" oftype decimal, | ||
"Geraet aktiv" oftype text, | ||
]; | ||
} | ||
|
||
transform CelsiusToFahrenheit { | ||
from Celsius oftype decimal; | ||
to Fahrenheit oftype decimal; | ||
Fahrenheit: (Celsius * 9/5) + 32; | ||
} | ||
|
||
block CelsiusToFahrenheitTransformer oftype TableTransformer { | ||
inputColumns: ['Temperatur']; | ||
outputColumn: 'Temperatur'; | ||
use: CelsiusToFahrenheit; | ||
} | ||
|
||
block CelsiusToFahrenheitBatteryTransformer oftype TableTransformer { | ||
inputColumns: ['Batterietemperatur']; | ||
outputColumn: 'Batterietemperatur'; | ||
use: CelsiusToFahrenheit; | ||
} | ||
|
||
constraint ValidGeraetNumberRange on decimal: | ||
value > 0; | ||
|
||
|
||
valuetype ValidGeraetNumber oftype integer { | ||
constraints: [ ValidGeraetNumberRange ]; | ||
} | ||
|
||
block MowestaLoader oftype SQLiteLoader { | ||
table: "temperatures"; | ||
file: "./temperatures.sqlite"; | ||
} | ||
|
||
MowestaExtractor | ||
-> ZipArchiveInterpreter | ||
-> MowestaDataFilePicker | ||
-> MowestaInterpreter | ||
-> MowestaCSVInterpreter | ||
-> RenameTemperaturCellWriter | ||
-> RenameTemperaturBatteryCellWriter | ||
-> MowestaTableInterpreter | ||
-> CelsiusToFahrenheitTransformer | ||
-> CelsiusToFahrenheitBatteryTransformer | ||
-> MowestaLoader; | ||
|
||
} |