Skip to content

Commit d3ec9c6

Browse files
authored
Merge branch 'main' into dev
2 parents 1d27b56 + dfe3ec8 commit d3ec9c6

File tree

5 files changed

+59
-35
lines changed

5 files changed

+59
-35
lines changed

CHANGELOG.rst

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,14 @@
11
Change Log
22
===========
33

4+
0.2.49
5+
------
6+
Fix prices-clean rarely discarding good data #2122
7+
8+
0.2.47 and 0.2.48
9+
-----------------
10+
Add yf.download(multi_level_index)
11+
412
0.2.46
513
------
614
Fix regression in 0.2.45 #2094

meta.yaml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
{% set name = "yfinance" %}
2-
{% set version = "0.2.46" %}
2+
{% set version = "0.2.49" %}
33

44
package:
55
name: "{{ name|lower }}"

yfinance/multi.py

Lines changed: 48 additions & 32 deletions
Original file line numberDiff line numberDiff line change
@@ -42,38 +42,54 @@ def download(tickers, start=None, end=None, actions=False, threads=True,
4242
multi_level_index=True) -> Union[_pd.DataFrame, None]:
4343
"""
4444
Download yahoo tickers
45-
46-
Args:
47-
tickers (str or list): List of tickers to download.
48-
period (str): Time period to download.
49-
Valid periods are: '1d', '5d', '1mo', '3mo', '6mo', '1y', '2y', '5y', '10y', 'ytd', 'max'.
50-
Either use `period` or specify `start` and `end`.
51-
interval (str): Data interval.
52-
Valid intervals are: '1m', '2m', '5m', '15m', '30m', '60m', '90m', '1h', '1d', '5d', '1wk', '1mo', '3mo'.
53-
Intraday data is limited to the last 60 days.
54-
start (str): Start date (YYYY-MM-DD) or _datetime, inclusive.
55-
Default is 99 years ago.
56-
Example: For `start="2020-01-01"`, the first data point will be "2020-01-01".
57-
end (str): End date (YYYY-MM-DD) or _datetime, exclusive.
58-
Default is the current date.
59-
Example: For `end="2023-01-01"`, the last data point will be "2022-12-31".
60-
group_by (str): Group data by 'ticker' or 'column'. Default is 'column'.
61-
prepost (bool): Include pre and post market data in results? Default is False.
62-
auto_adjust (bool): Automatically adjust all OHLC data? Default is False.
63-
repair (bool): Detect and repair currency unit mixups (e.g., 100x errors)? Default is False.
64-
keepna (bool): Keep rows with NaN values returned by Yahoo? Default is False.
65-
actions (bool): Download dividend and stock split data? Default is False.
66-
threads (bool or int): Number of threads for mass downloading. Default is True (automatically determines the number of threads).
67-
ignore_tz (bool): Ignore timezones when combining data across timezones?
68-
Default depends on the interval. For intraday intervals, the default is False. For daily and above, the default is True.
69-
proxy (str, optional): URL of the proxy server. Default is None.
70-
rounding (bool, optional): Round values to two decimal places? Default is False.
71-
timeout (None or float, optional): Maximum time to wait for a response, in seconds. Can be a fraction of a second (e.g., 0.01). Default is None.
72-
session (None or Session, optional): Pass a custom session object for all requests. Default is None.
73-
multi_level_index (bool): Optional. Always return a MultiIndex DataFrame? Default is False
74-
75-
Returns:
76-
pd.DataFrame or None
45+
:Parameters:
46+
tickers : str, list
47+
List of tickers to download
48+
period : str
49+
Valid periods: 1d,5d,1mo,3mo,6mo,1y,2y,5y,10y,ytd,max
50+
Either Use period parameter or use start and end
51+
interval : str
52+
Valid intervals: 1m,2m,5m,15m,30m,60m,90m,1h,1d,5d,1wk,1mo,3mo
53+
Intraday data cannot extend last 60 days
54+
start: str
55+
Download start date string (YYYY-MM-DD) or _datetime, inclusive.
56+
Default is 99 years ago
57+
E.g. for start="2020-01-01", the first data point will be on "2020-01-01"
58+
end: str
59+
Download end date string (YYYY-MM-DD) or _datetime, exclusive.
60+
Default is now
61+
E.g. for end="2023-01-01", the last data point will be on "2022-12-31"
62+
group_by : str
63+
Group by 'ticker' or 'column' (default)
64+
prepost : bool
65+
Include Pre and Post market data in results?
66+
Default is False
67+
auto_adjust: bool
68+
Adjust all OHLC automatically? Default is False
69+
repair: bool
70+
Detect currency unit 100x mixups and attempt repair
71+
Default is False
72+
keepna: bool
73+
Keep NaN rows returned by Yahoo?
74+
Default is False
75+
actions: bool
76+
Download dividend + stock splits data. Default is False
77+
threads: bool / int
78+
How many threads to use for mass downloading. Default is True
79+
ignore_tz: bool
80+
When combining from different timezones, ignore that part of datetime.
81+
Default depends on interval. Intraday = False. Day+ = True.
82+
proxy: str
83+
Optional. Proxy server URL scheme. Default is None
84+
rounding: bool
85+
Optional. Round values to 2 decimal places?
86+
timeout: None or float
87+
If not None stops waiting for a response after given number of
88+
seconds. (Can also be a fraction of a second e.g. 0.01)
89+
session: None or Session
90+
Optional. Pass your own session object to be used for all requests
91+
multi_level_index: bool
92+
Optional. Always return a MultiIndex DataFrame? Default is True
7793
"""
7894
logger = utils.get_yf_logger()
7995

yfinance/utils.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -613,7 +613,7 @@ def fix_Yahoo_returning_live_separate(quotes, interval, tz_exchange, repair=Fals
613613
# - exception is volume, *slightly* greater on final row (and matches website)
614614
if dt1.date() == dt2.date():
615615
# Last two rows are on same day. Drop second-to-last row
616-
quotes = quotes.drop(quotes.index[n - 2])
616+
quotes = _pd.concat([quotes.iloc[:-2], quotes.iloc[-1:]])
617617
else:
618618
if interval == "1wk":
619619
last_rows_same_interval = dt1.year == dt2.year and dt1.week == dt2.week

yfinance/version.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1 +1 @@
1-
version = "0.2.48"
1+
version = "0.2.49"

0 commit comments

Comments
 (0)