Skip to content

Commit 0bc22f8

Browse files
authored
Merge pull request #2108 from ranaroussi/main
sync main -> dev
2 parents 8daa477 + 5e942fd commit 0bc22f8

File tree

6 files changed

+32
-10
lines changed

6 files changed

+32
-10
lines changed

CHANGELOG.rst

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

4+
0.2.46
5+
------
6+
Fix regression in 0.2.45 #2094
7+
8+
0.2.45
9+
------
10+
Features:
11+
- Screener #2066 @ericpien
12+
Fixes
13+
- Tickers keyerror #2068 @antoniouaa
14+
- IndexError in some history() debug messages #2087
15+
- improve dividend repair #2090
16+
Maintenance
17+
- fix unit tests contextual imports #2067
18+
- fix typos #2072 @algonell
19+
- add Pyright type checking #2059 @marco-carvalho
20+
421
0.2.44
522
------
623
Features:

README.md

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -28,7 +28,6 @@ Yahoo! finance API is intended for personal use only.**
2828
<a target="new" href="https://pypi.python.org/pypi/yfinance"><img border=0 src="https://img.shields.io/pypi/v/yfinance.svg?maxAge=60%" alt="PyPi version"></a>
2929
<a target="new" href="https://pypi.python.org/pypi/yfinance"><img border=0 src="https://img.shields.io/pypi/status/yfinance.svg?maxAge=60" alt="PyPi status"></a>
3030
<a target="new" href="https://pypi.python.org/pypi/yfinance"><img border=0 src="https://img.shields.io/pypi/dm/yfinance.svg?maxAge=2592000&label=installs&color=%2327B1FF" alt="PyPi downloads"></a>
31-
<a target="new" href="https://travis-ci.com/github/ranaroussi/yfinance"><img border=0 src="https://img.shields.io/travis/ranaroussi/yfinance/main.svg?maxAge=1" alt="Travis-CI build status"></a>
3231
<a target="new" href="https://www.codefactor.io/repository/github/ranaroussi/yfinance"><img border=0 src="https://www.codefactor.io/repository/github/ranaroussi/yfinance/badge" alt="CodeFactor"></a>
3332
<a target="new" href="https://github.com/ranaroussi/yfinance"><img border=0 src="https://img.shields.io/github/stars/ranaroussi/yfinance.svg?style=social&label=Star&maxAge=60" alt="Star this repo"></a>
3433
<a target="new" href="https://twitter.com/aroussi"><img border=0 src="https://img.shields.io/twitter/follow/aroussi.svg?style=social&label=Follow&maxAge=60" alt="Follow me on twitter"></a>
@@ -376,6 +375,6 @@ details on your rights to use the actual data downloaded.
376375

377376
### P.S.
378377

379-
Please drop me an note with any feedback you have.
378+
Please drop me a note with any feedback you have.
380379

381380
**Ran Aroussi**

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.44" %}
2+
{% set version = "0.2.46" %}
33

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

yfinance/multi.py

Lines changed: 10 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -34,10 +34,11 @@
3434

3535

3636
@utils.log_indent_decorator
37-
def download(tickers, start=None, end=None, actions=False, threads=True, ignore_tz=None,
38-
group_by='column', auto_adjust=False, back_adjust=False, repair=False, keepna=False,
39-
progress=True, period="max", interval="1d", prepost=False,
40-
proxy=None, rounding=False, timeout=10, session=None):
37+
def download(tickers, start=None, end=None, actions=False, threads=True,
38+
ignore_tz=None, group_by='column', auto_adjust=False, back_adjust=False,
39+
repair=False, keepna=False, progress=True, period="max", interval="1d",
40+
prepost=False, proxy=None, rounding=False, timeout=10, session=None,
41+
multi_level_index=True):
4142
"""Download yahoo tickers
4243
:Parameters:
4344
tickers : str, list
@@ -85,6 +86,8 @@ def download(tickers, start=None, end=None, actions=False, threads=True, ignore_
8586
seconds. (Can also be a fraction of a second e.g. 0.01)
8687
session: None or Session
8788
Optional. Pass your own session object to be used for all requests
89+
multi_level_index: bool
90+
Optional. Always return a MultiIndex DataFrame? Default is False
8891
"""
8992
logger = utils.get_yf_logger()
9093

@@ -215,6 +218,9 @@ def download(tickers, start=None, end=None, actions=False, threads=True, ignore_
215218
data.columns = data.columns.swaplevel(0, 1)
216219
data.sort_index(level=0, axis=1, inplace=True)
217220

221+
if not multi_level_index and len(tickers) == 1:
222+
data = data.droplevel(0 if group_by == 'ticker' else 1, axis=1).rename_axis(None, axis=1)
223+
218224
return data
219225

220226

yfinance/screener/screener.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -98,8 +98,8 @@ def _fetch_and_parse(self) -> None:
9898
self._response = response['finance']['result'][0]
9999
except Exception as e:
100100
logger = utils.get_yf_logger()
101-
logger.error(f"Failed to get screener data for '{self._body.get('query', "query not set")}' reason: {e}")
101+
logger.error(f"Failed to get screener data for '{self._body.get('query', 'query not set')}' reason: {e}")
102102
logger.debug("Got response: ")
103103
logger.debug("-------------")
104104
logger.debug(f" {response}")
105-
logger.debug("-------------")
105+
logger.debug("-------------")

yfinance/version.py

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

0 commit comments

Comments
 (0)