NSE National Stock Exchange of India Limited is the leading stock exchange of India, located in Mumbai, Maharashtra. NSE was established in 1992 as the first dematerialized electronic exchange in the country.
nsetools is a library for collecting real time data from National Stock Exchange of India. It can be used in various types of projects which requires fetching live quotes for a given stock or index or building large data sets for further data analytics. We can also build command line interface applications which can provide us live market details at a blazing fast speeds, much faster than any browser. The accuracy of data is only as correct as provided on http://www.nseindia.com
In order to install nse tools we have to use the command given below
pip install nsetools
Creating a Nse object
Python3
from nsetools import Nse
nse = Nse()
print (nse)
|
Output :
Driver Class for National Stock Exchange (NSE)
Getting Information
Python3
from nsetools import Nse
nse = Nse()
quote = nse.get_quote( 'sbin' )
print (quote[ 'companyName' ])
print ( "Buy Price : " + str (quote[ 'buyPrice1' ]))
|
Output :
State Bank of India
Buy Price : 191.45
Python3
from nsetools import Nse
nse = Nse()
quote = nse.get_quote( 'sbin' )
print (quote[ 'companyName' ])
print ( "Average Price : " + str (quote[ 'averagePrice' ]))
|
Output :
State Bank of India
Average Price : 193.9
Whether you're preparing for your first job interview or aiming to upskill in this ever-evolving tech landscape,
GeeksforGeeks Courses are your key to success. We provide top-quality content at affordable prices, all geared towards accelerating your growth in a time-bound manner. Join the millions we've already empowered, and we're here to do the same for you. Don't miss out -
check it out now!
Last Updated :
03 Aug, 2021
Like Article
Save Article