Skip to content

Command-Line-Interface to manage Policy Design Lab database.

Notifications You must be signed in to change notification settings

policy-design-lab/data-ingestion

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

20 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Command-Line-Interface to Manage Policy Design Lab Database (PostgreSQL)

Installation

python3 -m venv venv
source venv/bin/activate
pip install --upgrade pip
pip install -r requirements.txt

Usage

usage: main.py [-h] --db_name DB_NAME [--db_user DB_USER] [--db_password DB_PASSWORD] [--db_host DB_HOST] [--db_port DB_PORT] [--drop_existing] [--log_level LOG_LEVEL] [--create-tables] [--create-database] [--create-schema]
               [--schema-name SCHEMA_NAME] [--init-tables] [--insert-data]

Create a PostgreSQL database and tables, and insert/update data into the tables.

options:
  -h, --help            show this help message and exit
  --db_name DB_NAME, -d DB_NAME
                        Name of the database to create
  --db_user DB_USER, -u DB_USER
                        Username to connect to the database
  --db_password DB_PASSWORD, -p DB_PASSWORD
                        Password to connect to the database. We STRONGLY RECOMMEND using .pgpass file. If you use .pgpass file, this command-line argument can be ignored.
  --db_host DB_HOST     Host of the database
  --db_port DB_PORT     Port of the database
  --drop_existing, -x   Drop existing database if exists
  --log_level LOG_LEVEL, -l LOG_LEVEL
                        Log level
  --create-tables, -c   Create tables
  --create-database, -C
                        Construct database if it does not exist.
  --create-schema, -S   Create schema if it does not exist.
  --schema-name SCHEMA_NAME, -N SCHEMA_NAME
                        Name of the new schema, default pdl.
  --init-tables, -i     Initialize tables
  --insert-data, -I     Insert data

Example

python main.py -d "pdl_db" -u '' -p '' -c -C -i

About

Command-Line-Interface to manage Policy Design Lab database.

Resources

Stars

Watchers

Forks

Packages

No packages published

Contributors 3

  •  
  •  
  •