2021-08-18 19:01:17 +02:00
|
|
|
package main
|
|
|
|
|
|
|
|
import (
|
|
|
|
"flag"
|
|
|
|
"fmt"
|
|
|
|
"insee_number_translator/data"
|
|
|
|
)
|
|
|
|
|
|
|
|
func main() {
|
2021-08-19 19:18:09 +02:00
|
|
|
var preProcess bool
|
|
|
|
flag.BoolVar(&preProcess, "pre-process", false, "Pre-process data files.")
|
2021-08-18 19:01:17 +02:00
|
|
|
flag.Parse()
|
2021-08-19 19:18:09 +02:00
|
|
|
|
|
|
|
if preProcess {
|
|
|
|
data.PreProcessRawData("data/raw_data", "data/curated_data")
|
|
|
|
return
|
|
|
|
}
|
|
|
|
|
2021-08-18 19:01:17 +02:00
|
|
|
numbers := flag.Args()
|
|
|
|
for _, number := range numbers {
|
|
|
|
insee, err := data.NewInseeData(number)
|
|
|
|
if err != nil {
|
|
|
|
fmt.Println(err)
|
|
|
|
} else {
|
|
|
|
fmt.Println(insee)
|
|
|
|
}
|
|
|
|
fmt.Println()
|
|
|
|
}
|
|
|
|
}
|