diff --git a/CHANGELOG.rst b/CHANGELOG.rst index 04d1a829a..383ccdb63 100644 --- a/CHANGELOG.rst +++ b/CHANGELOG.rst @@ -1,14 +1,28 @@ Change Log =========== -0.2.51 +0.2.52 ------ +Features: +- Improve Screener & docs #2207 +- Add Market summary & status #2175 +- Support custom period in Ticker.history() #2192 +- raise YfRateLimitError if rate limited #2108 +- add more options to Search #2191 Fixes: -- earnings_dates #2169 +- remove hardcoded keys in Analysis #2194 +- handle Yahoo changed Search response #2202 +Maintenance: +- add optional dependencies to requirements.txt #2199 + +0.2.51 +------ Features: - Screener tweaks #2168 - Search #2160 - get_news() expose count #2173 +Fixes: +- earnings_dates #2169 0.2.50 ------ diff --git a/doc/source/reference/index.rst b/doc/source/reference/index.rst index 35357d627..c907ed26c 100644 --- a/doc/source/reference/index.rst +++ b/doc/source/reference/index.rst @@ -15,6 +15,7 @@ The following are the publicly available classes, and functions exposed by the ` - :attr:`Ticker `: Class for accessing single ticker data. - :attr:`Tickers `: Class for handling multiple tickers. +- :attr:`Market `: Class for accessing market summary. - :attr:`download `: Function to download market data for multiple tickers. - :attr:`Search `: Class for accessing search results. - :attr:`Sector `: Domain class for accessing sector information. @@ -33,6 +34,7 @@ The following are the publicly available classes, and functions exposed by the ` yfinance.ticker_tickers yfinance.stock + yfinance.market yfinance.financials yfinance.analysis yfinance.market diff --git a/doc/source/reference/yfinance.market.rst b/doc/source/reference/yfinance.market.rst index a11a8e82c..58021ad09 100644 --- a/doc/source/reference/yfinance.market.rst +++ b/doc/source/reference/yfinance.market.rst @@ -1,16 +1,41 @@ ===================== -Market Summary +Market ===================== + .. currentmodule:: yfinance + + Class ------------ The `Market` class, allows you to access market data in a Pythonic way. + .. autosummary:: :toctree: api/ + Market Market Sample Code --------------------------- -The `Market` class, allows you to access market summary data in a Pythonic way. +------------------ + .. literalinclude:: examples/market.py - :language: python \ No newline at end of file + :language: python + + +Markets +------------ +There are 8 different markets available in Yahoo Finance. + +* US +* GB + +\ + +* ASIA +* EUROPE + +\ + +* RATES +* COMMODITIES +* CURRENCIES +* CRYPTOCURRENCIES \ No newline at end of file diff --git a/meta.yaml b/meta.yaml index 79f27c557..9a2bb69b7 100644 --- a/meta.yaml +++ b/meta.yaml @@ -1,5 +1,5 @@ {% set name = "yfinance" %} -{% set version = "0.2.51" %} +{% set version = "0.2.52" %} package: name: "{{ name|lower }}" diff --git a/yfinance/domain/market.py b/yfinance/domain/market.py index e4c7d8b25..d01868702 100644 --- a/yfinance/domain/market.py +++ b/yfinance/domain/market.py @@ -5,7 +5,7 @@ from ..const import _QUERY1_URL_ import json as _json -class Market(): +class Market: def __init__(self, market:'str', session=None, proxy=None, timeout=30): self.market = market self.session = session @@ -52,7 +52,7 @@ def _parse_data(self): status_params = { "formatted": True, "key": "finance", - "lang": "en-GB", + "lang": "en-US", "market": self.market } @@ -73,11 +73,11 @@ def _parse_data(self): self._status['timezone'] = self._status['timezone'][0] del self._status['time'] # redundant try: - self._status.update( - open = dt.datetime.fromisoformat(self._status["open"]), - close = dt.datetime.fromisoformat(self._status["close"]), - tz = dt.timezone(self._status["timezone"]["gmtoffset"], self._status["timezone"]["short"]) - ) + self._status.update({ + "open": dt.datetime.fromisoformat(self._status["open"]), + "close": dt.datetime.fromisoformat(self._status["close"]), + "tz": dt.timezone(dt.timedelta(hours=int(self._status["timezone"]["gmtoffset"]))/1000, self._status["timezone"]["short"]) + }) except Exception as e: self._logger.error(f"{self.market}: Failed to update market status") self._logger.debug(f"{type(e)}: {e}") diff --git a/yfinance/version.py b/yfinance/version.py index 8142a0d90..d346b9971 100644 --- a/yfinance/version.py +++ b/yfinance/version.py @@ -1 +1 @@ -version = "0.2.51" +version = "0.2.52"