Example #1
0
def load_lse_ids(missing=True):
    u = stocks.load_uk_universe()
    if missing:
        existing = stocks.get_universe('LSE')
        u2 = u.loc[~u.index.isin(existing.index)]
        if u2.empty:
            s = stocks.load_google_returns(data_name='Spread')
            s = s.iloc[-1].loc[u.index]
            u = u.loc[s.isnull()]
        else:
            u = u2
    ans = pd.Series([])
    i = 0
    for ticker in u.index:
        logger.info('Loading %s' % ticker)
        tmp = load_lse_id(ticker)
        if tmp is None:
            i += 1
        else:
            i = 0
            ans.loc[ticker] = tmp
        if i >= 5:
            break
    if not ans.empty:
        ans.name = 'LSE'
        stocks._save_tickers(ans, 'LSE')
Example #2
0
def load_smx_universe(override=False):
    logger.info('Loading SMX universe')
    data = scrape.read_smx_stocks()
    if override:
        tu.delete_description(stocks.DATABASE_NAME,
                              stocks.STOCKS_DESCRIPTION,
                              column_list=['SMX'])
    stocks._save_tickers(data, 'SMX')
Example #3
0
def update_lse_ids():
    ans = pd.Series([])
    ans.loc['AA'] = 'GB00BMSKPJ95GBGBXSSMM'
    ans.loc['ASAI'] = 'GB00BDFXHW57GBGBXSSMM'
    ans.loc['RWI'] = 'GB0007995243GBGBXSSMM'
    ans.loc['HWDN'] = 'GB0005576813GBGBXSTMM'
    ans.loc['INCH'] = 'GB00B61TVQ02GBGBXSTMM'
    ans.loc['NEX'] = 'GB0006215205GBGBXSTMM'
    ans.loc['VCT'] = 'GB0009292243GBGBXSTMM'
    ans.loc['VVO'] = 'GB00BDGT2M75GBGBXSTMM'
    ans.loc['BRK'] = 'GB00B067N833GBGBXAMSM'
    ans.loc['CTH'] = 'GB00B0KWHQ09GBGBXAMSM'
    ans.loc['PAM'] = 'GB00BZB2KR63GBGBXAMSM'
    ans.name = 'LSE'
    stocks._save_tickers(ans, 'LSE')
Example #4
0
def load_reuters_ids(missing=True):
    u = stocks.load_uk_universe().max(axis=1)
    if missing:
        existing = stocks.get_universe('Reuters')
        u = u.loc[~u.index.isin(existing.index)]
    ans = pd.Series([])
    i = 0
    for ticker in u.index:
        logger.info('Loading %s' % ticker)
        tmp = load_reuters_id(ticker, u.loc[ticker])
        if tmp is None:
            i += 1
        else:
            i = 0
            ans.loc[ticker] = tmp
        if i >= 5:
            break
    if not ans.empty:
        ans.name = 'Reuters'
        stocks._save_tickers(ans, 'Reuters')
Example #5
0
def import_reuters_ids():
    filename = get_filename('ReutersID')
    ans = pd.read_excel(filename)
    ans.index = ans.column_name
    stocks._save_tickers(ans.Reuters, 'Reuters')
Example #6
0
def import_lse_ids():
    filename = get_filename('LSEID')
    ans = pd.read_excel(filename)
    ans.index = ans.column_name
    stocks._save_tickers(ans.LSE, 'LSE')
Example #7
0
def update_reuters_ids():
    ans = pd.Series([])
    ans.loc['ASAI'] = 'GB00BDFXHW57GBGBXSSMM'
    ans.name = 'Reuters'
    stocks._save_tickers(ans, 'Reuters')