def __init__(self, db=True, safe=True, use_cache=True): # see http://stackoverflow.com/questions/8134444 NBAAgent.__init__(self) self.logger = logging.getLogger(__name__) if db: self.db = FantasyLabsNBAPg() self.safe = safe if use_cache: self.scraper = FantasyLabsNBAScraper(use_cache=use_cache) else: self.scraper = FantasyLabsNBAScraper() self.parser = FantasyLabsNBAParser()
def __init__(self, db=True, safe=True): ''' Args: db (bool): compose NBAComPg object as self.nbadb safe (bool): create backups of tables prior to inserts ''' NBAAgent.__init__(self) self.logger = logging.getLogger(__name__) self.scraper = NBAComScraper() self.parser = NBAComParser() self.safe = safe self.nbas = NBASeasons() if db: self.nbadb = NBAComPg() else: self.nbadb = None