Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Dataset "us-income-ttm" not on disk. #15

Closed
DextyGummy opened this issue Mar 7, 2023 · 3 comments
Closed

Dataset "us-income-ttm" not on disk. #15

DextyGummy opened this issue Mar 7, 2023 · 3 comments
Labels
bug Something isn't working

Comments

@DextyGummy
Copy link

Bug Report

Please make sure you have the latest simfin package installed by running:

pip install --upgrade simfin

And make sure you have downloaded fresh data-files from the SimFin server
by setting refresh_days=0 (see example below).

If you still cannot solve the problem and need our help, then please provide
the following.

Description

I am getting error message Dataset "us-income-ttm" not on disk. when attempting to download data into colab notebook. I also get this error message when running tutorials that have the same code as mine. This did not happen with the previous version. I was able to down signal dataset prior to Feb 22, 2023 update. I have the latest version 0.9.0.

System Details

  • Python version
  • Simfin version : 0.9.0
  • Other relevant package versions
  • Operation System and version
  • Computer's CPU, RAM-size, free HD space, etc.
  • Other relevant system information

Code Example

Import the main functionality from the SimFin Python API.

import simfin as sf

Import names used for easy access to SimFin's data-columns.

from simfin.names import *

import seaborn as sns

# Configure simfin.
sf.set_data_dir('~/simfin_data/')
sf.load_api_key(path='~/simfin_api_key.txt', default_key='free')

# Interested in the US stock-market.
market = 'us'

offset = pd.DateOffset(days=60)

Refresh the fundamental datasets (Income Statements etc.)

every 30 days.

refresh_days = 30

# Refresh the dataset with shareprices every 10 days.
 refresh_days_shareprices = 10

%%time
hub = sf.StockHub(market=market, tickers=tickers, offset=offset,
              refresh_days=refresh_days,
              refresh_days_shareprices=refresh_days_shareprices)

#try to download data using StockHub Object

 %%time
 df_fin_signals = hub.fin_signals(variant='daily')

also tried same code from SimFin tutorial https://github.com/SimFin/simfin-tutorials/blob/master/05_Data_Hubs.ipynb but get #similar error message

Result / Error

Dataset "us-income-ttm" not on disk.

HTTPError Traceback (most recent call last)
in

/usr/local/lib/python3.8/dist-packages/simfin/hubs.py in fin_signals(self, variant, func)
619 # This is only really necessary if the cache-file needs refreshing,
620 # but it is easier to program like this and the overhead is small.
--> 621 df_income_ttm = self.load_income(variant='ttm')
622 df_balance_ttm = self.load_balance(variant='ttm')
623 df_cashflow_ttm = self.load_cashflow(variant='ttm')

5 frames
/usr/local/lib/python3.8/dist-packages/requests/models.py in raise_for_status(self)
941
942 if http_error_msg:
--> 943 raise HTTPError(http_error_msg, response=self)
944
945 def close(self):

HTTPError: 401 Client Error: Unauthorized for url: https://backend.simfin.com/api/bulk-download?dataset=income&variant=ttm&market=us

@DextyGummy DextyGummy added the bug Something isn't working label Mar 7, 2023
@thf24
Copy link
Member

thf24 commented Mar 7, 2023

If you are getting a 401 error it means that there is something wrong with your API-key.

For me the code is running fine.

Can you try instead of sf.load_api_key the following (probably the file with the api-key is not found):
sf.set_api_key(api_key='YOUR_KEY')

@DextyGummy
Copy link
Author

DextyGummy commented Mar 7, 2023 via email

@thf24
Copy link
Member

thf24 commented Mar 8, 2023

E-mail was not confirmed - if your e-mail is not confirmed in our system the API calls won't work. We will add a notice to the website if that should be the case.

@thf24 thf24 closed this as completed Mar 8, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

No branches or pull requests

2 participants