From a158fe958cd767d008b63702fe9a984874003812 Mon Sep 17 00:00:00 2001 From: Lorenz Stechauner Date: Tue, 14 Mar 2023 00:01:18 +0100 Subject: [PATCH] Update readme --- README.md | 26 ++++++++++++++++++++++++-- wgmaster/export.py | 2 +- 2 files changed, 25 insertions(+), 3 deletions(-) diff --git a/README.md b/README.md index 5b197c5..0185e44 100644 --- a/README.md +++ b/README.md @@ -11,13 +11,35 @@ # Migrate DB +## Export WGdaten + +**ATTENTION:** Office and Python versions have to be both 64-bit or both 32-bit! + +This will export all tables from the MS Access file `WGDATEN.accdb` +as csv files to the directory `TABLES_DIR`. + +```shell +cd wgmaster +python3 export.py WGDATEN.accdb -o TABLES_DIR +cd.. +``` + +## Generate PLZ + +This will generate `data/90.plz.sql`. + ```shell cd data python3 plz.py cd .. +```` + +## Migrate + +```shell cd wgmaster -python3 migrate.py -q IN_DIR OUT_DIR -d DB.sqlite3 -python3 import.py OUT_DIR NEW.sqlite3 +python3 migrate.py -q TABLES_DIR MIGRATE_DIR -d DB.sqlite3 +python3 import.py MIGRATE_DIR NEW.sqlite3 cd .. ``` diff --git a/wgmaster/export.py b/wgmaster/export.py index 1782431..d8bb0e1 100644 --- a/wgmaster/export.py +++ b/wgmaster/export.py @@ -28,7 +28,7 @@ def convert(tbl: str, name: str, a: Any) -> str: if __name__ == '__main__': parser = argparse.ArgumentParser() parser.add_argument('-o', '--output', default='tables') - parser.add_argument('wgdaten') + parser.add_argument('wgdaten', metavar='WGDATEN') args = parser.parse_args() os.makedirs(args.output, exist_ok=True)