Skip to main content
Ameet Malekar
Algo Trader
Asked a question last year

How to get nifty weekly and monthly expiry "dates", and trading holidays dates using python?

Join FYERS Community to pick others' brains on Trading/Investing

I know this is not an answer to your question. But sharing how i am handling the exact requirement of mine. What i do is to select the distinct expiry dates from Setup a cron to clear old data and update the database comparing current date, so that it remains updated on each day.

I have another table for holidays, where the trading holidays are collected from nse website Once in a year process.

You can use pandas_market_calendar module to get list of all holidays historical to current. Refer this Make sure to change market to BSE.