LocalDB_create_CNBP   A
last analyzed

Complexity

Total Complexity 1

Size/Duplication

Total Lines 37
Duplicated Lines 0 %

Importance

Changes 0
Metric Value
wmc 1
eloc 18
dl 0
loc 37
rs 10
c 0
b 0
f 0

1 Function

Rating   Name   Duplication   Size   Complexity  
A create_localDB_CNBP() 0 23 1
1
#This file create a SQLite local database for CNBP requirement.
2
#Creation: 2018-07-11T160228EST
3
#Author: Yang Ding
4
5
import os
6
from dotenv import load_dotenv
7
from LocalDB_create import LocalDBCreate
8
import LocalDB_schema
9
10
def create_localDB_CNBP(Path):
11
12
    # name of the TableName to be created
13
14
15
    #Create the PRIMARY KEY column.
16
17
18
    load_dotenv()
19
20
    username = os.getenv("LORISusername")
21
    password = os.getenv("LORISpassword")
22
23
    # Create the variable array that store the columns information to be used later in loop for column creation
24
    TableName = LocalDB_schema.CNBP_schema_table_name
25
    KeyField = LocalDB_schema.CNBP_schema_keyfield
26
    NewColumns = LocalDB_schema.CNBP_schema_fields
27
    NewColumnsTypes = LocalDB_schema.CNBP_schema_fields_types
28
29
    NewColumnSpec = zip(NewColumns, NewColumnsTypes)
30
    NewColumnSpecList = list(NewColumnSpec)
31
32
    return LocalDBCreate(Path, TableName, KeyField, NewColumnSpecList)
33
34
# Only executed when running directly.
35
if __name__ == '__main__':
36
    create_localDB_CNBP("..\LocalDB\LocalDB_CNBPs.sqlite")