A python module that allows you to access the financial data of public Indian companies listed on the National Stock Exchange and the Bombay Stock Exchange from the popular website Moneycontrol in a pythonic way.
This is not an official Moneycontrol python library or api
Currently you can retrieve following data
- Small summary about the business of the company
- Basic data about the company like Share Price, Market Cap, PE etc.
- Latest share price
- Basic info about the peers of the company
- Financial ratios and per share data of the company
- Latest shareholding pattern
Clone this repo and write your own scripts in your local repo
The comp is the main class of mc module. Data of any entity can be retrieved using this class.
The comp class accepts one argument. The symbol of the company, etf etc. The symbol of any entity can be found in its url on moneycontrol.
Symbol of Reliance Industries Ltd. is RI
Symbol of Asian Paints is AP31
import mcontrol as mc
#the comp module will return all the data about the company
#the comp module accepts the company symbol as argument
ril = mc.comp('RI')
# about the company
print(ril.about)
# a dictionary listing basic details like closing price, market cap, pe etc
print(ril.info)
# to get the latest price
print(ril.latestPrice)
# returns a list of dictionary containing info about the peers of the company
print(ril.peers())
# to get the peers result as pandas dataframe
print(ril.peers(dframe=True))
# or
print(ril.peers(True))
# returns a dictionary with basic per share data like eps, bvps and financial ratios
print(ril.pershare())
# returns a dictionary with latest shareholding data
print(ril.latestShareholding())
# url of the company on moneycontrol
print(ril.url)
lxml
beautifulsoup4