예제 #1
0
 def __init__(self, username, password, database='nbadb', host='localhost', port=5432, table_names=None):
     '''
     TODO: add table_names as property
     '''
     NBAPostgres.__init__(self, username, password, database)
     logging.getLogger(__name__).addHandler(logging.NullHandler())
     if table_names:
         self.table_names = table_names
     else:
         self.table_names = {'pgl': 'player_gamelogs', 'tgl': 'team_gamelogs',
                             'pl': 'players', 'ps': 'playerstats_daily', 'ts': 'teamstats_daily',
                             'tod': 'team_opponent_dashboard'}
예제 #2
0
 def __init__(self, username, password, database = 'nbadb',
              host = 'localhost', port = 5432):
     '''
     Subclass of NBAPostgres for fantasylabs-specific data
     Args:
         username: str 'nba'
         password: str 'abc123'
         database: str 'nba'
         host: default localhost
         port: defalut 5432
     '''
     logging.getLogger(__name__).addHandler(logging.NullHandler())
     NBAPostgres.__init__(self, user=username, password=password,
                          database=database)
예제 #3
0
 def __init__(self):
     NBAPostgres.__init__(self)
     self.logger = logging.getLogger(__name__)
     self.nbaplayers = NBAPlayers(db=True)
     self.player_xref = {}
예제 #4
0
파일: nbacom.py 프로젝트: sansbacon/nba
    def __init__(self, with_db=True):

        # see http://stackoverflow.com/questions/8134444
        NBAPostgres.__init__(self)
        self.logger = logging.getLogger(__name__)