From 12e815d977010827621bc2bfb0be697b9b870e8e Mon Sep 17 00:00:00 2001 From: Ran Aroussi Date: Thu, 17 Oct 2024 21:51:59 +0100 Subject: [PATCH 01/11] Update README.md --- README.md | 1 - 1 file changed, 1 deletion(-) diff --git a/README.md b/README.md index 9fa7a793..a4f01172 100644 --- a/README.md +++ b/README.md @@ -28,7 +28,6 @@ Yahoo! finance API is intended for personal use only.** PyPi version PyPi status PyPi downloads -Travis-CI build status CodeFactor Star this repo Follow me on twitter From f19dff247ee48f8cff5976273e2fe70971a07b4f Mon Sep 17 00:00:00 2001 From: ValueRaider Date: Sun, 20 Oct 2024 22:59:16 +0100 Subject: [PATCH 02/11] Version 0.2.45 --- CHANGELOG.rst | 13 +++++++++++++ meta.yaml | 2 +- yfinance/version.py | 2 +- 3 files changed, 15 insertions(+), 2 deletions(-) diff --git a/CHANGELOG.rst b/CHANGELOG.rst index ed372196..a6c380cb 100644 --- a/CHANGELOG.rst +++ b/CHANGELOG.rst @@ -1,6 +1,19 @@ Change Log =========== +0.2.45 +------ +Features: +- Screener #2066 @ericpien +Fixes +- Tickers keyerror #2068 @antoniouaa +- IndexError in some history() debug messages #2087 +- improve dividend repair #2090 +Maintenance +- fix unit tests contextual imports #2067 +- fix typos #2072 @algonell +- add Pyright type checking #2059 @marco-carvalho + 0.2.44 ------ Features: diff --git a/meta.yaml b/meta.yaml index c7bbfa9f..5cb50356 100644 --- a/meta.yaml +++ b/meta.yaml @@ -1,5 +1,5 @@ {% set name = "yfinance" %} -{% set version = "0.2.44" %} +{% set version = "0.2.45" %} package: name: "{{ name|lower }}" diff --git a/yfinance/version.py b/yfinance/version.py index 36448d88..820fe194 100644 --- a/yfinance/version.py +++ b/yfinance/version.py @@ -1 +1 @@ -version = "0.2.44" +version = "0.2.45" From c218848a690bfcb0f76f56a5b4804bef25bbd0c6 Mon Sep 17 00:00:00 2001 From: Yuhong Chen <24971568+FX196@users.noreply.github.com> Date: Sun, 20 Oct 2024 17:36:22 -0700 Subject: [PATCH 03/11] Fix malformed f-string --- yfinance/screener/screener.py | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/yfinance/screener/screener.py b/yfinance/screener/screener.py index cdb6e667..2d35968e 100644 --- a/yfinance/screener/screener.py +++ b/yfinance/screener/screener.py @@ -98,8 +98,8 @@ def _fetch_and_parse(self) -> None: self._response = response['finance']['result'][0] except Exception as e: logger = utils.get_yf_logger() - logger.error(f"Failed to get screener data for '{self._body.get('query', "query not set")}' reason: {e}") + logger.error(f"Failed to get screener data for '{self._body.get('query', 'query not set')}' reason: {e}") logger.debug("Got response: ") logger.debug("-------------") logger.debug(f" {response}") - logger.debug("-------------") \ No newline at end of file + logger.debug("-------------") From 0ec5151ff31b87f38e5bdd672ac7a8fcfde524e5 Mon Sep 17 00:00:00 2001 From: ValueRaider Date: Mon, 21 Oct 2024 18:37:53 +0100 Subject: [PATCH 04/11] Version 0.2.46 --- CHANGELOG.rst | 4 ++++ meta.yaml | 2 +- yfinance/version.py | 2 +- 3 files changed, 6 insertions(+), 2 deletions(-) diff --git a/CHANGELOG.rst b/CHANGELOG.rst index a6c380cb..5322b37a 100644 --- a/CHANGELOG.rst +++ b/CHANGELOG.rst @@ -1,6 +1,10 @@ Change Log =========== +0.2.46 +------ +Fix regression in 0.2.45 #2094 + 0.2.45 ------ Features: diff --git a/meta.yaml b/meta.yaml index 5cb50356..5a828d1b 100644 --- a/meta.yaml +++ b/meta.yaml @@ -1,5 +1,5 @@ {% set name = "yfinance" %} -{% set version = "0.2.45" %} +{% set version = "0.2.46" %} package: name: "{{ name|lower }}" diff --git a/yfinance/version.py b/yfinance/version.py index 820fe194..762daf28 100644 --- a/yfinance/version.py +++ b/yfinance/version.py @@ -1 +1 @@ -version = "0.2.45" +version = "0.2.46" From b32e57fcfe247b9af22ad5bc9c32a8c4bb1309af Mon Sep 17 00:00:00 2001 From: Ikko Eltociear Ashimine Date: Tue, 22 Oct 2024 17:19:56 +0900 Subject: [PATCH 05/11] docs: update README.md minor fix --- README.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/README.md b/README.md index 8bbec2bc..d631bdf5 100644 --- a/README.md +++ b/README.md @@ -375,6 +375,6 @@ details on your rights to use the actual data downloaded. ### P.S. -Please drop me an note with any feedback you have. +Please drop me a note with any feedback you have. **Ran Aroussi** From 4beb489f823364158d13102bbbe3991a5926836c Mon Sep 17 00:00:00 2001 From: Ran Aroussi Date: Fri, 25 Oct 2024 11:31:20 +0100 Subject: [PATCH 06/11] Refactor multi.py to handle single tickers and rename columns --- .DS_Store | Bin 0 -> 8196 bytes yfinance/multi.py | 3 +++ 2 files changed, 3 insertions(+) create mode 100644 .DS_Store diff --git a/.DS_Store b/.DS_Store new file mode 100644 index 0000000000000000000000000000000000000000..871a8c04b6ca0b4f2c3976c5bde94307dbd8ff98 GIT binary patch literal 8196 zcmeHM&ubGw6n@jDO=2mgsF359-lVk&l+q$XjPcS#4@MNJl4i5pcIhS)n#3R_5GeMb z7cb&T5bS@ThqCl8(!if?|Tndv5_f?%LCF!N33y*KZhZ#T1<4FHgI z%}D~p0U&~vVQdJS4u#oS4U|4PGKxqr9{lBGwm^&JfTtNS3K#{90!9I&fKi}V6u@UT zE0HeGePK1NQNSp0EEQn;gN2o0N@7zW-#W12M*zeS4)cQj80#Qf5>pbJ0?~qnh)_fk zO5_oPh;SUYq+d#6Q=kY3A`c%#W+w84LU?wZ-{S5-QUXnD6fg<|6&S^#5S)W$@Sv)l z-*Y>URa=o}GPX}`9E+Urf6whce}7T8JBQlKE6Tfp?F5EGxRn=Hpa!;<9foIv9x8_~ zdyTu>^Y0jk1M?JVn@M*sjSnp1G<=@hP=NwaaKP31z+BKn!NwIHR5x4_OxbhO@u@=C!>y@&+_g~s&->Xy;iO;03KQu5H4oAa7;ak}iTF+MV)mkN; zUt3_Gu2SmTt$yCV=DGD;?DQpCs^-0tyT$`N$3>T$*S(TM>uFjmITaq86^3Xu63xZp z>+4ff$#H8Y(HOVZlZn~sacg>ZrqPH-&Wuf-zmi+^izRxG5y!_K5eUN)TW}vcfpux> z4xIef$w$?A_rm`7J}{T6^kIIQ-h*84k%M~UzTo1HvEWK)+xWXXpRR-QWNBBzHr~C}0%$HwutYCYwp) zT&*7u2d8CcZ42unR#uo_Qy>q)h9Acf`EeX^{|`g#Tj Date: Fri, 25 Oct 2024 11:33:08 +0100 Subject: [PATCH 07/11] Delete .DS_Store --- .DS_Store | Bin 8196 -> 0 bytes 1 file changed, 0 insertions(+), 0 deletions(-) delete mode 100644 .DS_Store diff --git a/.DS_Store b/.DS_Store deleted file mode 100644 index 871a8c04b6ca0b4f2c3976c5bde94307dbd8ff98..0000000000000000000000000000000000000000 GIT binary patch literal 0 HcmV?d00001 literal 8196 zcmeHM&ubGw6n@jDO=2mgsF359-lVk&l+q$XjPcS#4@MNJl4i5pcIhS)n#3R_5GeMb z7cb&T5bS@ThqCl8(!if?|Tndv5_f?%LCF!N33y*KZhZ#T1<4FHgI z%}D~p0U&~vVQdJS4u#oS4U|4PGKxqr9{lBGwm^&JfTtNS3K#{90!9I&fKi}V6u@UT zE0HeGePK1NQNSp0EEQn;gN2o0N@7zW-#W12M*zeS4)cQj80#Qf5>pbJ0?~qnh)_fk zO5_oPh;SUYq+d#6Q=kY3A`c%#W+w84LU?wZ-{S5-QUXnD6fg<|6&S^#5S)W$@Sv)l z-*Y>URa=o}GPX}`9E+Urf6whce}7T8JBQlKE6Tfp?F5EGxRn=Hpa!;<9foIv9x8_~ zdyTu>^Y0jk1M?JVn@M*sjSnp1G<=@hP=NwaaKP31z+BKn!NwIHR5x4_OxbhO@u@=C!>y@&+_g~s&->Xy;iO;03KQu5H4oAa7;ak}iTF+MV)mkN; zUt3_Gu2SmTt$yCV=DGD;?DQpCs^-0tyT$`N$3>T$*S(TM>uFjmITaq86^3Xu63xZp z>+4ff$#H8Y(HOVZlZn~sacg>ZrqPH-&Wuf-zmi+^izRxG5y!_K5eUN)TW}vcfpux> z4xIef$w$?A_rm`7J}{T6^kIIQ-h*84k%M~UzTo1HvEWK)+xWXXpRR-QWNBBzHr~C}0%$HwutYCYwp) zT&*7u2d8CcZ42unR#uo_Qy>q)h9Acf`EeX^{|`g#Tj Date: Fri, 25 Oct 2024 11:34:13 +0100 Subject: [PATCH 08/11] Update version.py --- yfinance/version.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/yfinance/version.py b/yfinance/version.py index 762daf28..a711e53f 100644 --- a/yfinance/version.py +++ b/yfinance/version.py @@ -1 +1 @@ -version = "0.2.46" +version = "0.2.47" From 6946f99e30164ad847be8f5e27a1bd80135fb67c Mon Sep 17 00:00:00 2001 From: Ran Aroussi Date: Fri, 25 Oct 2024 18:59:03 +0100 Subject: [PATCH 09/11] Refactor multi.py to handle single tickers and rename columns --- yfinance/multi.py | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/yfinance/multi.py b/yfinance/multi.py index 5a05434d..4150df71 100644 --- a/yfinance/multi.py +++ b/yfinance/multi.py @@ -37,7 +37,7 @@ def download(tickers, start=None, end=None, actions=False, threads=True, ignore_tz=None, group_by='column', auto_adjust=False, back_adjust=False, repair=False, keepna=False, progress=True, period="max", interval="1d", prepost=False, - proxy=None, rounding=False, timeout=10, session=None): + proxy=None, rounding=False, timeout=10, session=None, return_multi_index=True): """Download yahoo tickers :Parameters: tickers : str, list @@ -85,6 +85,8 @@ def download(tickers, start=None, end=None, actions=False, threads=True, ignore_ seconds. (Can also be a fraction of a second e.g. 0.01) session: None or Session Optional. Pass your own session object to be used for all requests + return_multi_index: bool + Optional. Always return a MultiIndex DataFrame? Default is False """ logger = utils.get_yf_logger() @@ -215,7 +217,7 @@ def download(tickers, start=None, end=None, actions=False, threads=True, ignore_ data.columns = data.columns.swaplevel(0, 1) data.sort_index(level=0, axis=1, inplace=True) - if len(tickers) == 1: + if not return_multi_index and len(tickers) == 1: data = data.droplevel(0 if group_by == 'ticker' else 1, axis=1).rename_axis(None, axis=1) return data From 16072e87df4f63c679ca14ea7c3b15532b08a837 Mon Sep 17 00:00:00 2001 From: Ran Aroussi Date: Fri, 25 Oct 2024 18:59:19 +0100 Subject: [PATCH 10/11] Bump version to 0.2.48 --- yfinance/version.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/yfinance/version.py b/yfinance/version.py index a711e53f..31fd36d2 100644 --- a/yfinance/version.py +++ b/yfinance/version.py @@ -1 +1 @@ -version = "0.2.47" +version = "0.2.48" From 5e942fdec4a9bf67056ca199beb75c1f5ba40195 Mon Sep 17 00:00:00 2001 From: Ran Aroussi Date: Fri, 25 Oct 2024 19:02:07 +0100 Subject: [PATCH 11/11] Refactor multi.py to handle single tickers and rename columns --- yfinance/multi.py | 13 +++++++------ 1 file changed, 7 insertions(+), 6 deletions(-) diff --git a/yfinance/multi.py b/yfinance/multi.py index 4150df71..5a063050 100644 --- a/yfinance/multi.py +++ b/yfinance/multi.py @@ -34,10 +34,11 @@ @utils.log_indent_decorator -def download(tickers, start=None, end=None, actions=False, threads=True, ignore_tz=None, - group_by='column', auto_adjust=False, back_adjust=False, repair=False, keepna=False, - progress=True, period="max", interval="1d", prepost=False, - proxy=None, rounding=False, timeout=10, session=None, return_multi_index=True): +def download(tickers, start=None, end=None, actions=False, threads=True, + ignore_tz=None, group_by='column', auto_adjust=False, back_adjust=False, + repair=False, keepna=False, progress=True, period="max", interval="1d", + prepost=False, proxy=None, rounding=False, timeout=10, session=None, + multi_level_index=True): """Download yahoo tickers :Parameters: tickers : str, list @@ -85,7 +86,7 @@ def download(tickers, start=None, end=None, actions=False, threads=True, ignore_ seconds. (Can also be a fraction of a second e.g. 0.01) session: None or Session Optional. Pass your own session object to be used for all requests - return_multi_index: bool + multi_level_index: bool Optional. Always return a MultiIndex DataFrame? Default is False """ logger = utils.get_yf_logger() @@ -217,7 +218,7 @@ def download(tickers, start=None, end=None, actions=False, threads=True, ignore_ data.columns = data.columns.swaplevel(0, 1) data.sort_index(level=0, axis=1, inplace=True) - if not return_multi_index and len(tickers) == 1: + if not multi_level_index and len(tickers) == 1: data = data.droplevel(0 if group_by == 'ticker' else 1, axis=1).rename_axis(None, axis=1) return data