コード例 #1
0
 def __init__(self,
              config_file,
              proxies=None,
              timeout=300,
              max_retries=50,
              error_codes=[500, 503],
              internal_error_codes=[401, 403, 404, 429],
              host='localhost',
              port=27017,
              username=None,
              password=None,
              dbname='finance',
              collections=None):
     self.config = configwrapper.ConfigWrapper(config_file=config_file)
     collections = self.build_collections()
     self.collections = collections
     if proxies is None:
         proxies = {}
     if collections is None:
         collections = {}
     self.collections = collections
     self.quandl = quandlwrapper.QuandlWrapper(
         api_key=self.config.get_string('QUANDL', 'api_key'),
         proxies=proxies,
         timeout=timeout,
         max_retries=max_retries)
     self.mongo = mongomanager.MongoManager(
         port=self.config.get_int('FINANCIALDATA_MONGO', 'port'),
         host=self.config.get_string('FINANCIALDATA_MONGO', 'host'),
         username=self.config.get_string('FINANCIALDATA_MONGO', 'username'),
         password=self.config.get_string('FINANCIALDATA_MONGO', 'password'),
         dbname=self.config.get_string('FINANCIALDATA_MONGO', 'dbname'))
コード例 #2
0
 def __init__(self, config_file=None):
     self.config = configwrapper.ConfigWrapper(config_file=config_file)
     self.iexwrapper = iexwrapper.IexWrapper(
         token=self.config.get_string('IEX', 'token'))
     self.mongo = mongomanager.MongoManager(
         port=self.config.get_int('FINANCIALDATA_MONGO', 'port'),
         host=self.config.get_string('FINANCIALDATA_MONGO', 'host'),
         username=self.config.get_string('FINANCIALDATA_MONGO', 'username'),
         password=self.config.get_string('FINANCIALDATA_MONGO', 'password'),
         dbname=self.config.get_string('FINANCIALDATA_MONGO', 'dbname'))
     return
コード例 #3
0
 def __init__(self,
              host='127.0.0.1',
              port=27017,
              dbname='mydb',
              username=None,
              password=None,
              collections=None):
     if collections is None:
         collections = {}
     self.mongo = mongomanager.MongoManager(host=host,
                                            port=port,
                                            username=username,
                                            password=password,
                                            dbname=dbname)
     self.collections = collections
     self.companies = None
     self.mongo.create_collections(self.collections.values())
     self.clean_dbs()
コード例 #4
0
    def __init__(self,
                 config_file,
                 proxies=None,
                 timeout=300,
                 max_retries=20,
                 error_codes=range(500, 600),
                 internal_error_codes=range(400, 500),
                 host='localhost',
                 port=27017,
                 username=None,
                 password=None,
                 dbname='finance',
                 collections=None):
        self.config = configwrapper.ConfigWrapper(config_file=config_file)
        collections = self.build_collections()
        self.collections = collections
        if proxies is None:
            proxies = {}
        if collections is None:
            collections = {}
        self.av = alphavantagewrapper.AlphaVantage(
            api_key=self.config.get_string('ALPHAVANTAGE', 'api_key'),
            proxies=proxies,
            timeout=timeout,
            max_retries=max_retries,
            error_codes=error_codes,
            internal_error_codes=internal_error_codes)
        self.mongo = mongomanager.MongoManager(
            port=self.config.get_int('FINANCIALDATA_MONGO', 'port'),
            host=self.config.get_string('FINANCIALDATA_MONGO', 'host'),
            username=self.config.get_string('FINANCIALDATA_MONGO', 'username'),
            password=self.config.get_string('FINANCIALDATA_MONGO', 'password'),
            dbname=self.config.get_string('FINANCIALDATA_MONGO', 'dbname'))
        self.cq = commonqueries.CommonQueries(
            port=self.config.get_int('FINANCIALDATA_MONGO', 'port'),
            host=self.config.get_string('FINANCIALDATA_MONGO', 'host'),
            username=self.config.get_string('FINANCIALDATA_MONGO', 'username'),
            password=self.config.get_string('FINANCIALDATA_MONGO', 'password'),
            dbname=self.config.get_string('FINANCIALDATA_MONGO', 'dbname'),
            collections=collections)

        return
コード例 #5
0
 def __init__(self, config_file):
     self.config = configwrapper.ConfigWrapper(config_file=config_file)
     collections = self.build_collections()
     self.collections = collections
     if collections is None:
         collections = {}
     self.mongo = mongomanager.MongoManager(
         port=self.config.get_int('FINANCIALDATA_MONGO', 'port'),
         host=self.config.get_string('FINANCIALDATA_MONGO', 'host'),
         username=self.config.get_string('FINANCIALDATA_MONGO', 'username'),
         password=self.config.get_string('FINANCIALDATA_MONGO', 'password'),
         dbname=self.config.get_string('FINANCIALDATA_MONGO', 'dbname'))
     self.cq = commonqueries.CommonQueries(
         port=self.config.get_int('FINANCIALDATA_MONGO', 'port'),
         host=self.config.get_string('FINANCIALDATA_MONGO', 'host'),
         username=self.config.get_string('FINANCIALDATA_MONGO', 'username'),
         password=self.config.get_string('FINANCIALDATA_MONGO', 'password'),
         dbname=self.config.get_string('FINANCIALDATA_MONGO', 'dbname'),
         collections=collections)
     self.collections = collections
     self.n = nasdaqwrapper.NasdaqWrapper()
     self.mongo.create_collections(self.collections.values())
     return
コード例 #6
0
 def __init__(self,
              config_file,
              proxies=None,
              timeout=300,
              max_retries=50,
              error_codes=[500, 503],
              internal_error_codes=[401, 403, 404, 429]):
     self.config = configwrapper.ConfigWrapper(config_file=config_file)
     collections = self.build_collections()
     self.collections = collections
     auth = (self.config.get_string('INTRINIO', 'username'),
             self.config.get_string('INTRINIO', 'password'))
     if auth is None:
         auth = ()
     if proxies is None:
         proxies = {}
     if collections is None:
         collections = {}
     self.mongo = mongomanager.MongoManager(
         port=self.config.get_int('FINANCIALDATA_MONGO', 'port'),
         host=self.config.get_string('FINANCIALDATA_MONGO', 'host'),
         username=self.config.get_string('FINANCIALDATA_MONGO', 'username'),
         password=self.config.get_string('FINANCIALDATA_MONGO', 'password'),
         dbname=self.config.get_string('FINANCIALDATA_MONGO', 'dbname'))
     self.cq = commonqueries.CommonQueries(
         port=self.config.get_int('FINANCIALDATA_MONGO', 'port'),
         host=self.config.get_string('FINANCIALDATA_MONGO', 'host'),
         username=self.config.get_string('FINANCIALDATA_MONGO', 'username'),
         password=self.config.get_string('FINANCIALDATA_MONGO', 'password'),
         dbname=self.config.get_string('FINANCIALDATA_MONGO', 'dbname'),
         collections=collections)
     self.intrinio = intriniowrapper.IntrinioWrapper(
         auth, proxies, timeout, max_retries, error_codes,
         internal_error_codes)
     self.last_trade_day = pd.to_datetime(
         self.cq.get_last_complete_market_day())
     return
コード例 #7
0
 def __init__(self,
              config_file,
              proxies=None,
              timeout=300,
              max_retries=50,
              error_codes=[500, 503],
              internal_error_codes=[401, 403, 404, 429]):
     self.config = configwrapper.ConfigWrapper(config_file=config_file)
     collections = self.build_collections()
     self.collections = collections
     if proxies is None:
         proxies = {}
     self.fred = fredwrapper.FredWrapper(api_key=self.config.get_string(
         'FRED', 'api_key'),
                                         proxies=proxies,
                                         timeout=timeout,
                                         max_retries=max_retries)
     self.mongo = mongomanager.MongoManager(
         port=self.config.get_int('FINANCIALDATA_MONGO', 'port'),
         host=self.config.get_string('FINANCIALDATA_MONGO', 'host'),
         username=self.config.get_string('FINANCIALDATA_MONGO', 'username'),
         password=self.config.get_string('FINANCIALDATA_MONGO', 'password'),
         dbname=self.config.get_string('FINANCIALDATA_MONGO', 'dbname'))
     self.mongo.create_collections(self.collections.values())