Python nsetools
Syntax
from nsetools import Nse
nse = Nse()
# method to get quote of a stock
quote = nse.get_quote('TCS')
Example
from nsetools import Nse
nse = Nse()
# method to get quote of a stock
quote = nse.get_quote('TCS')
# print the quote
print(quote)
Output
{'symbol': 'TCS',
'series': 'EQ',
'open': 3045.0,
'high': 3064.0,
'low': 3031.0,
'ltP': 3055.7,
'ptsC': 7.25,
'per': 0.24,
'trdVol': 81087.0,
'trdVolM': 8.11,
'ntP': 2481.51,
'mVal': 201848.19,
'wkhi': 3378.0,
'wklo': 1850.0,
'xDt': '17-JUN-2021 00:00:00',
'cAct': 'N'}
Explanation
Python nsetools is a library that provides an easy-to-use API to perform stock market analysis and retrieve real-time stock quotes. The library provides methods to extract stock quotes, indices, upcoming events of companies from the National Stock Exchange (NSE) of India.
The syntax to use nsetools in Python is straightforward. First, the library is imported using the from nsetools import Nse
statement. An Nse
object is then created to access the various methods of the library. To get a quote of a particular stock, the get_quote()
method is called with the stock symbol as its argument. This returns a dictionary containing various information about the stock.
Use
The Python nsetools library can be used for performing stock market analysis, retrieving real-time stock quotes, and getting upcoming event details for companies listed on the National Stock Exchange (NSE) of India.
This library can be used by financial analysts, traders, and investors to perform technical and fundamental analysis of stocks, create trading strategies, and monitor real-time market movements.
Important Points
- The Python nsetools library can be installed using pip:
pip install nsetools
- The library provides methods to extract stock quotes, indices, upcoming events of companies from the National Stock Exchange (NSE) of India.
- The
get_quote()
method is used to retrieve the current market information of a stock, and the method returns a dictionary with various stock details. - The library provides access to historical data of stocks.
Summary
Python nsetools is a library that allows easy access to NSE data and real-time stock quotes in Python. It provides an easy-to-use API to perform stock market analysis and retrieve real-time stock quotes from the National Stock Exchange (NSE) of India. The library is essential for financial analysts, traders, and investors who want to perform technical and fundamental analysis of stocks.