-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathmain.py
37 lines (28 loc) · 944 Bytes
/
main.py
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
import pandas as pd
import sys, os
BASE_PATH = os.path.abspath(__file__+ './')
sys.path.append(BASE_PATH)
from inc.consts.consts import Consts as consts
from inc.classes.Exceptions import InputError
from inc.classes.Connection import Connection
class Easydb:
'''
EasyDB is a API to help you connect to your favourite SGDB's
Args:
sgdb : e.g 'mysql'
Return EasyDB object.
def connect
args:
host: e.g. 'localhost'
user: e.g. 'Username'
password: e.g. 'password'
database: e.g. 'database'
port: e.g. 0000
'''
def __init__ (self, sgdb):
if sgdb in consts.SGDB:
self.sgdb = sgdb
else:
raise InputError(sgdb, f'SGDB {sgdb} is not supported! Check documentation!')
def connect(self, **kwargs):
return Connection(self.sgdb, **kwargs)