Exemplo n.º 1
0
    broker.releaseAll()

    hist = broker.history(
        'arctic://{}:5672/YahooFinance/SPOT/FTSE/0500'.format(rpc_host))

    #hist = broker.history('arctic://{}:5672/isharp/AAPL'.format(rpc_host))
    # mtx = broker.view('arctic://{}:5672/InvestCo/CLOSING/SP/EOD'.format(rpc_host))

    appl_mtx = broker.checkout('arctic://{}:5672/isharp/AAPL'.format(rpc_host))
    results_mtx = broker.checkout(
        'arctic://{}:5672/evaluations_isharp/AAPL'.format(rpc_host))
    results_mtx.replace_content(
        appl_mtx.content.drop(['Low', 'Close', 'Open', 'High', 'Adj Close'],
                              axis=1))
    revision_info = RevisionInfo(who="Jupyter eval",
                                 what="latest results on saturday morning",
                                 when=datetime.datetime.now())
    broker.commit(results_mtx, revision_info)

    broker.releaseAll()
    hist = broker.history(
        'arctic://{}:5672/evaluations_isharp/AAPL'.format(rpc_host))
    print(hist)

    # row_data = []
    # dict_array = mtx.content.to_dict(orient='records')
    # for idx, row in enumerate(dict_array):
    #     row["date"]=mtx.content.index[idx].strftime("%d %b %Y")
    #     row_data.append(row)
    #
    # column_headers = list(mtx.content)