diff --git a/jugaad_data/__init__.py b/jugaad_data/__init__.py index e9f6256..c4324d0 100644 --- a/jugaad_data/__init__.py +++ b/jugaad_data/__init__.py @@ -1 +1 @@ -__version__= "0.25" \ No newline at end of file +__version__= "0.26" \ No newline at end of file diff --git a/jugaad_data/nse/live.py b/jugaad_data/nse/live.py index 7980557..cf480c1 100644 --- a/jugaad_data/nse/live.py +++ b/jugaad_data/nse/live.py @@ -19,6 +19,8 @@ class NSELive: "all_indices": "/allIndices", "live_index": "/equity-stockIndices", "index_option_chain": "/option-chain-indices", + "equity_option_chain": "/option-chain-equities", + "currency_option_chain": "/option-chain-currency", "pre_open_market": "/market-data-pre-open", "holiday_list": "/holiday-master?type=trading" } @@ -101,6 +103,16 @@ def index_option_chain(self, symbol="NIFTY"): data = {"symbol": symbol} return self.get("index_option_chain", data) + @live_cache + def equities_option_chain(self, symbol): + data = {"symbol": symbol} + return self.get("equity_option_chain", data) + + @live_cache + def currency_option_chain(self, symbol="USDINR"): + data = {"symbol": symbol} + return self.get("currency_option_chain", data) + @live_cache def live_fno(self): return self.live_index("SECURITIES IN F&O") diff --git a/tests/test_nse_live.py b/tests/test_nse_live.py index 1b63d5b..c37752d 100644 --- a/tests/test_nse_live.py +++ b/tests/test_nse_live.py @@ -61,6 +61,18 @@ def test_index_option_chain(): assert "filtered" in d assert "records" in d +def test_equities_option_chain(): + d = n.equities_option_chain("RELIANCE") + assert "filtered" in d + assert "records" in d + assert "data" in d["records"] + +def test_currency_option_chain(): + d = n.currency_option_chain("USDINR") + assert "filtered" in d + assert "records" in d + assert "data" in d["records"] + def test_live_fno(): d = n.live_fno() assert "SECURITIES IN F&O" == d['name']