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