Skip to contents

The function stops with an error message if the file does not have the file extension ".zip" or if the zip file does not contain the expected csv files or if a csv file does not contain all expected fields (columns). Expected file names and field names are provided config). If everything looks ok, the csv files in the zip file are extracted into a (new) folder in the app's "run" directory. The app directory is provided in the environment variable SEMA_BERLIN_PREP_APP_DIR.

Usage

import_db(zip_file, config, base_name = basename(zip_file))

Arguments

zip_file

path to zip file containing csv files

config

configuration object (list) describing the csv files

base_name

base name of the folder to be created. The current date will also be encoded in the folder name. By default the base name of the zip file (file name without file extension) is used.