diff --git a/doc/source/reference/examples/status.py b/doc/source/reference/examples/status.py index 7ef0bb5f..1fcf502e 100644 --- a/doc/source/reference/examples/status.py +++ b/doc/source/reference/examples/status.py @@ -3,18 +3,20 @@ # Get the market status of america US = yf.Status("US") -# Get the status - -US.status - -# Get when the market opens - +# Get the open time US.open -# Get when the market closes - +# Get the close time US.close -# Get the whether the market is open +# Get the timezone +US.timezone + +# Get the request time +US.request_time + +# Get the market status +US.is_open -US.is_open \ No newline at end of file +# Get the rest of the data +US.data \ No newline at end of file diff --git a/yfinance/status.py b/yfinance/status.py index 092817a8..0aacf9c8 100644 --- a/yfinance/status.py +++ b/yfinance/status.py @@ -76,42 +76,18 @@ def _parse_data(self, force:'bool'=False): self._is_open = True if self._raw_data["status"] == "open" else False @property - def raw_data(self): + def data(self): self._parse_data() return self._raw_data - - @property - def id(self) -> 't.Optional[str]': - return self.raw_data.get("id", None) - - @property - def name(self) -> 'str': - return self.raw_data.get("name", None) - - @property - def status(self) -> 't.Literal["open", "closed", None]': - return self.raw_data.get("status", None) - - @property - def yf_market_id(self) -> 't.Optional[str]': - return self.raw_data.get("yfit_market_id", None) - + @property def close(self) -> 't.Optional[dt]': return self._close - @property - def message(self) -> 't.Optional[str]': - return self.raw_data.get("message", None) - @property def open(self) -> 't.Optional[dt]': return self._open - - @property - def yf_status(self) -> 't.Optional[str]': # Move research needed for specific string literals - return self.raw_data.get("yfit_market_status", None) - + @property def request_time(self) -> 't.Optional[dt]': return self._time