Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Remove comment from yfinance?

Every time I try to get ticker price using yFinance, it would print this comment:

[*********************100%***********************]  1 of 1 completed

Is there anyway to get rid of it?

data = yf.download(ticker, startDate.strftime("%Y-%m-%d"), endDate.strftime("%Y-%m-%d"))
like image 556
Bill Software Engineer Avatar asked Aug 16 '26 21:08

Bill Software Engineer


1 Answers

The download method

def download(tickers, start=None, end=None, actions=False, threads=True,
             group_by='column', auto_adjust=False, back_adjust=False,
             progress=True, period="max", interval="1d", prepost=False,
             proxy=None, rounding=False, **kwargs):

has an undocumented parameter called progress that you should be able to set to False to disable the progress bar.

Try changing your download call to:

data = yf.download(
    ticker, startDate.strftime("%Y-%m-%d"), endDate.strftime("%Y-%m-%d"), progress=False)
like image 125
Ammar Askar Avatar answered Aug 18 '26 10:08

Ammar Askar



Donate For Us

If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!