From d32db365383054f3a9021198a04b743aaef5941d Mon Sep 17 00:00:00 2001 From: Alvaro Bartolome Date: Mon, 17 Oct 2022 18:39:06 +0200 Subject: [PATCH 1/2] =?UTF-8?q?=F0=9F=90=9B=20Set=20`days=5Fshift`=20just?= =?UTF-8?q?=20for=20`type=3DYield`?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit If more types run into this issue, those will be included in the list --- src/investiny/historical.py | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/src/investiny/historical.py b/src/investiny/historical.py index 3d72c56..020f1f8 100644 --- a/src/investiny/historical.py +++ b/src/investiny/historical.py @@ -45,7 +45,10 @@ def historical_data( Config.time_format if interval not in ["D", "W", "M"] else Config.date_format ) - has_volume = not investing_info(investing_id=investing_id)["has_no_volume"] + info = investing_info(investing_id=investing_id) + + has_volume = not info["has_no_volume"] + days_shift = 1 if info["type"] in ["Yield"] else 0 for to_datetime, from_datetime in zip(to_datetimes, from_datetimes): params = { @@ -55,8 +58,6 @@ def historical_data( "resolution": interval, } data = request_to_investing(endpoint="history", params=params) - # Dates are shifted due to an Investing.com issue with returned timestamps - days_shift = (datetime.fromtimestamp(data["t"][0]) - from_datetime).days # type: ignore result["date"] += [ (datetime.fromtimestamp(t) - timedelta(days=days_shift)).strftime( datetime_format From 07ae0774fb23baf0f6a196c2deee9399740b1ee5 Mon Sep 17 00:00:00 2001 From: Alvaro Bartolome Date: Mon, 17 Oct 2022 18:39:22 +0200 Subject: [PATCH 2/2] =?UTF-8?q?=F0=9F=94=96=20Set=20`investiny=20v0.7.1`?= =?UTF-8?q?=20release?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- pyproject.toml | 2 +- src/investiny/__init__.py | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/pyproject.toml b/pyproject.toml index 8d3b02a..2895235 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -4,7 +4,7 @@ build-backend = "poetry.core.masonry.api" [tool.poetry] name = "investiny" -version = "0.7.0" +version = "0.7.1" packages = [ { include = "investiny", from = "src" }, ] diff --git a/src/investiny/__init__.py b/src/investiny/__init__.py index 501e6ca..ae26ee7 100644 --- a/src/investiny/__init__.py +++ b/src/investiny/__init__.py @@ -1,7 +1,7 @@ """`investiny `: `investpy` but made tiny.""" __author__ = "Alvaro Bartolome, alvarobartt @ GitHub" -__version__ = "0.7.0" +__version__ = "0.7.1" from investiny.historical import historical_data # noqa: F401 from investiny.info import info # noqa: F401