Money control financial data extractor-Requires python 3.7+
Project description
mcfinance
Developed by ragha1992 and 05kashyap
Description:
Extract financial data from the money control website using the company name, BSE or NSE number. Export any selected data into either pandas dataframe or excel sheet with ease!
.
Disclaimer: We are in no way affiliated with moneycontrol.com
Usage:
Initialise company details:
Create an Extractor instance with company name/ BSE/ NSE ID and/or number of years(default), required documents(default), and filepath to write documents(default current directory).
from mcfinance import Extractor
Company = Extractor(user_input= "Company_name")
or input the BSE listing number(int) (number can be used as input directly)
Company = Extractor(user_input= BSEnumber)
or input the NSE listing code (code can be used as input directly)
Company = Extractor(user_input= "NSEcode")
#years and docs are default
Company = Extractor(user_input= "Company_name",years = 10, docs = ["balance sheet", "profit loss"], filepath = "/files")
any of the inputs can be changed later on as per user convenience
Company.set_inputs(years = 6)
We can view the initialised details using:
print(Company)
output:
Extractor object, name is Company_name, number of years is 10, documents are ["balancesheet", "profit loss"]
Export company details as excel file (default)
The get_info() function can be used to extract and store company data in an excel file. The file will be stored in the current filepath or the user defined filepath as per object initialisation
Company.get_info()
or
Company.get_info(option = 1)
Export company details into pandas data frame
DataFrame1, DataFrame2, DataFrame3 = Company.get_info(option = 0)
Plot certain attribute over selected years using matplotlib
The plotter() function can be used to show the companies attribute from a certain document over the selected period of time using a line graph from the matplotlib library. The function accepts a single required arguement for the attribute selection.
company.plotter("certain file attribute of the document")
Usage example:
cmp = Extractor("TCS", years = 10, docs = ["ratios"])
cmp.plotter("EV/EBITDA (X)")
output:
We can also plot the data of multiple companies on the same graph for comparison purposes
company1 = Extractor("TCS", years = 10, docs = ["ratios"])
company2 = Extractor("Infosys", years = 10, docs = ["ratios"])
Extractor.cmp_plot(comp = [company1, company2], attributes = "EV/EBITDA (X)")
output:
Project details
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
mcfinance-0.1.4.tar.gz
(245.3 kB
view hashes)
Built Distribution
mcfinance-0.1.4-py3-none-any.whl
(249.4 kB
view hashes)
Close
Hashes for mcfinance-0.1.4-py3-none-any.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 470717f938eb7c8df413285b78bd179b273524442f84cdfb1968ea10250a4fd1 |
|
MD5 | 66e909aca73487b32ca650a7dad49d1e |
|
BLAKE2b-256 | c4735cc63db33cad645cb4f9194b04cd04d7b178fea055dac5d77e25809c277a |