# config.py
import argparse
def parse_args():
parser = argparse.ArgumentParser(
description="Validate toponymical CSV files by loading into PostgreSQL and checking constraints."
)
parser.add_argument("--spatial", required=True, help="Path to the Spatial CSV file.")
parser.add_argument("--linguistic", required=True, help="Path to the Linguistic CSV file.")
parser.add_argument("--temporal", required=True, help="Path to the Temporal CSV file.")
parser.add_argument("--sources", required=True, help="Path to the Sources CSV file.")
parser.add_argument("--db-host", default="localhost", help="PostgreSQL host")
parser.add_argument("--db-port", default=5432, type=int, help="PostgreSQL port")
parser.add_argument("--db-name", required=True, help="PostgreSQL database name")
parser.add_argument("--db-user", required=True, help="PostgreSQL username")
parser.add_argument("--db-password", required=False, help="PostgreSQL password")
return parser.parse_args()
# Database connection parameters (example, adjust as needed)
DB_PARAMS = {
"host": None,
"port": None,
"dbname": None,
"user": None,
"password": None
}
def update_db_params(args):
DB_PARAMS.update({
"host": args.db_host,
"port": args.db_port,
"dbname": args.db_name,
"user": args.db_user,
"password": args.db_password
})