00:00If this is your first time here, welcome.
00:03My name is Vivek and I'm a financially independent algo trader.
00:05This channel is all about building a community of algo traders.
00:07We discuss everything about algo trading using Python, building and backtesting trading strategies, market updates, and much more.
00:13Please do visit our community website fabtrader.in.
00:15Also do check out my other YouTube channel, Fab Wealth, where I talk about my own financial independence journey and share tools, methods, and strategies that help me achieve my financial freedom.
00:24Previously, I had uploaded this video about downloading NSE data from the new NSE website using Python.
00:30If you haven't watched this video, please do so.
00:33You might ask, there are already a number of Python packages that download NSE data and do we really need another one?
00:38Right.
00:38Well, there is a real lead for it.
00:40I'll explain why.
00:42NSE, as you know, constantly update their website and due to this, the API endpoints keep changing.
00:46However, most of the Python packages that you see on GitHub don't keep up with these updates.
00:50So either most of the packages stopped working already or do not have all the functionalities that we normally look for.
00:56And that's the reason I thought I'll put this utility together.
00:59As part of my commitment towards this community, I'm not only going to keep the script updated with any changes to the NSE website, but I'll also keep enhancing it to include other new things in future.
01:08In this video, I'll talk about one of the recent announcements I made to the utility, and it's all about fetching the corporate actions data from the NSE website.
01:16As you are aware, the corporate actions include bonus issues, stock splits, dividends, buybacks, and other things like that.
01:23For people who follow specific stocks, this information becomes very crucial in their decision making.
01:27Some even use it for sentiment analysis and some for event-based training strategies.
01:32So I'm hoping that this particular update will be useful to people who specifically look for this type of data.
01:36Let's now take a look at the Python implementation.
01:38It has two scripts.
01:39The first one is called the NSE utility pipe.
01:41This is the main utility Python script.
01:43This contains all the functions, which does various downloads from NSE.
01:47All you need to do is just copy this entire file and then place this file within your source root.
01:52And now let's take a look at how to use this utility.
01:55So all you need to do is just import the NSE utility pipe as usual.
01:58And then you create an instance of the main class under NSE utility, which is NSE utility dot NSE utils.
02:03So this becomes the instance.
02:05And then the usage is quite simple.
02:06All you need to do is just type NSE dot and then invoke the specific method in this case, get corporate action.
02:11And then when you run the script, it gives you a pandas data frame containing all the information that you saw over on the NSE website.
02:18There are some additional variations on how you could do it.
02:20For example, this downloads the entire data.
02:22I believe there's close to about 13 years worth of data on the NSE website.
02:26If you want specifically for a time period, you could use this filter function,
02:29which is you can give a starting date and the ending date,
02:31and then it will download all corporate actions that happen within that time frame.
02:36And also if you want specific data, for example, if you only need a bonus data,
02:39you could always do that by giving the argument filter and then type either bonus, dividend,
02:44split or buyback, and it will only download that type of data that you want.
02:48This is a wildcard search, so you can give any search term here,
02:51and then it will return the rows that contain that particular search term.
02:55I'll be providing the link to this particular blog article in the description.
02:59This provides you a detailed account on how to use this functionality,
03:03including the source code.
03:04And then you can simply copy that and use it.
03:06I'll also provide you the link to the other main blog article that I wrote.
03:11This contains the full source code of the actual utility.
03:13So this is the NSE utility that I talked about.
03:15All you need to do is just copy this and save it as nseutility.py in your source directory,
03:20and then follow the rest of the instructions that I had already covered.
03:24So that's pretty much it for this video.
03:26I have a few more announcements that I've done for this utility,
03:28which I'll be covering in the videos to come.
03:30I hope you like this.
03:32If there are any comments, feedbacks, or suggestions, please do leave a comment.
03:37And I'll see you in the next video.
03:38If you genuinely found this video useful, please consider subscribing and liking the video.
03:42And I will see you soon in another video.
03:44And until then, take care and happy trading.
Comments