add datasets and other usefull files
This commit is contained in:
33
Makefile
Normal file
33
Makefile
Normal file
@@ -0,0 +1,33 @@
|
||||
DATABASE_NAME=SSB
|
||||
|
||||
DATABASE_FOLDER=${DATABASE_NAME}_dataset
|
||||
DATABASE_FILE=${DATABASE_FOLDER}/${DATABASE_NAME}.db
|
||||
|
||||
all: execute-script
|
||||
|
||||
execute-script:
|
||||
python3 concentration_test.py
|
||||
|
||||
pip-install:
|
||||
bin/pip3 install -r requirements.txt
|
||||
|
||||
reset: delete-database import-from-csv
|
||||
|
||||
open:
|
||||
sqlite3 flight_delay.db # open the interactive sqlite prompt
|
||||
|
||||
import-from-csv:
|
||||
echo ${DATABASE_FILE}
|
||||
sqlite3 ${DATABASE_FILE} ";" # create empty database
|
||||
sqlite3 ${DATABASE_FILE} '.read ${DATABASE_FOLDER}/create_tables.sql'
|
||||
# load csv files
|
||||
ls ${DATABASE_FOLDER}/csv | sed "s/\(.*\)\.csv/\1/" | xargs -n1 | while read table; do \
|
||||
echo "loading table '$$table' :"; \
|
||||
sqlite-utils insert ${DATABASE_FILE} $$table ${DATABASE_FOLDER}/csv/$$table.csv --csv; \
|
||||
done
|
||||
|
||||
delete-database:
|
||||
rm -f ${DATABASE_FILE}
|
||||
|
||||
|
||||
|
Reference in New Issue
Block a user