insee_number_translator/main.go

30 lines
488 B
Go
Raw Normal View History

2021-08-18 19:01:17 +02:00
package main
import (
"flag"
"fmt"
"insee_number_translator/data"
)
func main() {
var preProcess bool
flag.BoolVar(&preProcess, "pre-process", false, "Pre-process data files.")
2021-08-18 19:01:17 +02:00
flag.Parse()
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()
}
}