Market Cap

This commit is contained in:
Tommaso Verzegnassi 2023-05-10 11:35:58 +02:00
parent b09974058a
commit 8dd206ce01
92 changed files with 211 additions and 2 deletions

View file

@ -0,0 +1,2 @@
,company_name,Market capitalization
0,AAPL,2701718978560
1 company_name Market capitalization
2 0 AAPL 2701718978560

View file

@ -0,0 +1,2 @@
,company_name,Market capitalization
0,ABBV,259050717184
1 company_name Market capitalization
2 0 ABBV 259050717184

View file

@ -0,0 +1,2 @@
,company_name,Market capitalization
0,ABT,191719243776
1 company_name Market capitalization
2 0 ABT 191719243776

View file

@ -0,0 +1,2 @@
,company_name,Market capitalization
0,ACN,166529908736
1 company_name Market capitalization
2 0 ACN 166529908736

View file

@ -0,0 +1,2 @@
,company_name,Market capitalization
0,ADBE,157173547008
1 company_name Market capitalization
2 0 ADBE 157173547008

View file

@ -0,0 +1,2 @@
,company_name,Market capitalization
0,AMAT,96208232448
1 company_name Market capitalization
2 0 AMAT 96208232448

View file

@ -0,0 +1,2 @@
,company_name,Market capitalization
0,AMGN,125262274560
1 company_name Market capitalization
2 0 AMGN 125262274560

View file

@ -0,0 +1,2 @@
,company_name,Market capitalization
0,AMZN,1093963874304
1 company_name Market capitalization
2 0 AMZN 1093963874304

View file

@ -0,0 +1,2 @@
,company_name,Market capitalization
0,APD,62169919488
1 company_name Market capitalization
2 0 APD 62169919488

View file

@ -0,0 +1,2 @@
,company_name,Market capitalization
0,AVGO,257871675392
1 company_name Market capitalization
2 0 AVGO 257871675392

View file

@ -0,0 +1,2 @@
,company_name,Market capitalization
0,BAC,220426682368
1 company_name Market capitalization
2 0 BAC 220426682368

View file

@ -0,0 +1,2 @@
,company_name,Market capitalization
0,BA,121449799680
1 company_name Market capitalization
2 0 BA 121449799680

View file

@ -0,0 +1,2 @@
,company_name,Market capitalization
0,BDX,70904348672
1 company_name Market capitalization
2 0 BDX 70904348672

View file

@ -0,0 +1,2 @@
,company_name,Market capitalization
0,BIDU,42063650816
1 company_name Market capitalization
2 0 BIDU 42063650816

View file

@ -0,0 +1,2 @@
,company_name,Market capitalization
0,BMY,142857797632
1 company_name Market capitalization
2 0 BMY 142857797632

View file

@ -0,0 +1,2 @@
,company_name,Market capitalization
0,CAT,110234705920
1 company_name Market capitalization
2 0 CAT 110234705920

View file

@ -0,0 +1,2 @@
,company_name,Market capitalization
0,CCI,50761191424
1 company_name Market capitalization
2 0 CCI 50761191424

View file

@ -0,0 +1,2 @@
,company_name,Market capitalization
0,CHTR,51044929536
1 company_name Market capitalization
2 0 CHTR 51044929536

View file

@ -0,0 +1,2 @@
,company_name,Market capitalization
0,CMCSA,165169037312
1 company_name Market capitalization
2 0 CMCSA 165169037312

View file

@ -0,0 +1,2 @@
,company_name,Market capitalization
0,CME,66414739456
1 company_name Market capitalization
2 0 CME 66414739456

View file

@ -0,0 +1,2 @@
,company_name,Market capitalization
0,COST,222091853824
1 company_name Market capitalization
2 0 COST 222091853824

View file

@ -0,0 +1,2 @@
,company_name,Market capitalization
0,CRM,196959830016
1 company_name Market capitalization
2 0 CRM 196959830016

View file

@ -0,0 +1,2 @@
,company_name,Market capitalization
0,CSCO,190332764160
1 company_name Market capitalization
2 0 CSCO 190332764160

View file

@ -0,0 +1,2 @@
,company_name,Market capitalization
0,CSX,65098260480
1 company_name Market capitalization
2 0 CSX 65098260480

View file

@ -0,0 +1,2 @@
,company_name,Market capitalization
0,CVS,89703636992
1 company_name Market capitalization
2 0 CVS 89703636992

View file

@ -0,0 +1,2 @@
,company_name,Market capitalization
0,CVX,301475102720
1 company_name Market capitalization
2 0 CVX 301475102720

View file

@ -0,0 +1,2 @@
,company_name,Market capitalization
0,DE,113029054464
1 company_name Market capitalization
2 0 DE 113029054464

View file

@ -0,0 +1,2 @@
,company_name,Market capitalization
0,DHR,173524336640
1 company_name Market capitalization
2 0 DHR 173524336640

View file

@ -0,0 +1,2 @@
,company_name,Market capitalization
0,DIS,186663452672
1 company_name Market capitalization
2 0 DIS 186663452672

View file

@ -0,0 +1,2 @@
,company_name,Market capitalization
0,DUK,75562041344
1 company_name Market capitalization
2 0 DUK 75562041344

View file

@ -0,0 +1,2 @@
,company_name,Market capitalization
0,D,47230664704
1 company_name Market capitalization
2 0 D 47230664704

View file

@ -0,0 +1,2 @@
,company_name,Market capitalization
0,EXC,42388529152
1 company_name Market capitalization
2 0 EXC 42388529152

View file

@ -0,0 +1,2 @@
,company_name,Market capitalization
0,FDX,57466609664
1 company_name Market capitalization
2 0 FDX 57466609664

View file

@ -0,0 +1,2 @@
,company_name,Market capitalization
0,FIS,32969119744
1 company_name Market capitalization
2 0 FIS 32969119744

View file

@ -0,0 +1,2 @@
,company_name,Market capitalization
0,GE,110118273024
1 company_name Market capitalization
2 0 GE 110118273024

View file

@ -0,0 +1,2 @@
,company_name,Market capitalization
0,GILD,98291187712
1 company_name Market capitalization
2 0 GILD 98291187712

View file

@ -0,0 +1,2 @@
,company_name,Market capitalization
0,GOOGL,1365771026432
1 company_name Market capitalization
2 0 GOOGL 1365771026432

View file

@ -0,0 +1,2 @@
,company_name,Market capitalization
0,GS,107969134592
1 company_name Market capitalization
2 0 GS 107969134592

View file

@ -0,0 +1,2 @@
,company_name,Market capitalization
0,HD,294261653504
1 company_name Market capitalization
2 0 HD 294261653504

View file

@ -0,0 +1,2 @@
,company_name,Market capitalization
0,HON,131224911872
1 company_name Market capitalization
2 0 HON 131224911872

View file

@ -0,0 +1,2 @@
,company_name,Market capitalization
0,IBM,110027808768
1 company_name Market capitalization
2 0 IBM 110027808768

View file

@ -0,0 +1,2 @@
,company_name,Market capitalization
0,INTC,125547102208
1 company_name Market capitalization
2 0 INTC 125547102208

View file

@ -0,0 +1,2 @@
,company_name,Market capitalization
0,ISRG,105662521344
1 company_name Market capitalization
2 0 ISRG 105662521344

View file

@ -0,0 +1,2 @@
,company_name,Market capitalization
0,JNJ,418525478912
1 company_name Market capitalization
2 0 JNJ 418525478912

View file

@ -0,0 +1,2 @@
,company_name,Market capitalization
0,JPM,398629568512
1 company_name Market capitalization
2 0 JPM 398629568512

View file

@ -0,0 +1,2 @@
,company_name,Market capitalization
0,KO,274135105536
1 company_name Market capitalization
2 0 KO 274135105536

View file

@ -0,0 +1,2 @@
,company_name,Market capitalization
0,LIN,178556026880
1 company_name Market capitalization
2 0 LIN 178556026880

View file

@ -0,0 +1,2 @@
,company_name,Market capitalization
0,LLY,406649569280
1 company_name Market capitalization
2 0 LLY 406649569280

View file

@ -0,0 +1,2 @@
,company_name,Market capitalization
0,LMT,114480488448
1 company_name Market capitalization
2 0 LMT 114480488448

View file

@ -0,0 +1,2 @@
,company_name,Market capitalization
0,LOW,123517247488
1 company_name Market capitalization
2 0 LOW 123517247488

View file

@ -0,0 +1,2 @@
,company_name,Market capitalization
0,LRCX,69288542208
1 company_name Market capitalization
2 0 LRCX 69288542208

View file

@ -0,0 +1,2 @@
,company_name,Market capitalization
0,MA,362885054464
1 company_name Market capitalization
2 0 MA 362885054464

View file

@ -0,0 +1,2 @@
,company_name,Market capitalization
0,MCD,216589697024
1 company_name Market capitalization
2 0 MCD 216589697024

View file

@ -0,0 +1,2 @@
,company_name,Market capitalization
0,MCO,56138153984
1 company_name Market capitalization
2 0 MCO 56138153984

View file

@ -0,0 +1,2 @@
,company_name,Market capitalization
0,MDT,119205625856
1 company_name Market capitalization
2 0 MDT 119205625856

View file

@ -0,0 +1,2 @@
,company_name,Market capitalization
0,MMC,88743051264
1 company_name Market capitalization
2 0 MMC 88743051264

View file

@ -0,0 +1,2 @@
,company_name,Market capitalization
0,MMM,55608541184
1 company_name Market capitalization
2 0 MMM 55608541184

View file

@ -0,0 +1,2 @@
,company_name,Market capitalization
0,MO,82897256448
1 company_name Market capitalization
2 0 MO 82897256448

View file

@ -0,0 +1,2 @@
,company_name,Market capitalization
0,MRK,297971580928
1 company_name Market capitalization
2 0 MRK 297971580928

View file

@ -0,0 +1,2 @@
,company_name,Market capitalization
0,MSFT,2282695426048
1 company_name Market capitalization
2 0 MSFT 2282695426048

View file

@ -0,0 +1,2 @@
,company_name,Market capitalization
0,NEE,152930091008
1 company_name Market capitalization
2 0 NEE 152930091008

View file

@ -0,0 +1,2 @@
,company_name,Market capitalization
0,NFLX,147649855488
1 company_name Market capitalization
2 0 NFLX 147649855488

View file

@ -0,0 +1,2 @@
,company_name,Market capitalization
0,NKE,192277446656
1 company_name Market capitalization
2 0 NKE 192277446656

View file

@ -0,0 +1,2 @@
,company_name,Market capitalization
0,NSC,47417413632
1 company_name Market capitalization
2 0 NSC 47417413632

View file

@ -0,0 +1,2 @@
,company_name,Market capitalization
0,NVDA,705703706624
1 company_name Market capitalization
2 0 NVDA 705703706624

View file

@ -0,0 +1,2 @@
,company_name,Market capitalization
0,ORCL,259558768640
1 company_name Market capitalization
2 0 ORCL 259558768640

View file

@ -0,0 +1,2 @@
,company_name,Market capitalization
0,PEP,267464736768
1 company_name Market capitalization
2 0 PEP 267464736768

View file

@ -0,0 +1,2 @@
,company_name,Market capitalization
0,PFE,217196511232
1 company_name Market capitalization
2 0 PFE 217196511232

View file

@ -0,0 +1,2 @@
,company_name,Market capitalization
0,PG,362289856512
1 company_name Market capitalization
2 0 PG 362289856512

View file

@ -0,0 +1,2 @@
,company_name,Market capitalization
0,PM,148467924992
1 company_name Market capitalization
2 0 PM 148467924992

View file

@ -0,0 +1,2 @@
,company_name,Market capitalization
0,PYPL,73998786560
1 company_name Market capitalization
2 0 PYPL 73998786560

View file

@ -0,0 +1,2 @@
,company_name,Market capitalization
0,SCHW,87188955136
1 company_name Market capitalization
2 0 SCHW 87188955136

View file

@ -0,0 +1,2 @@
,company_name,Market capitalization
0,SO,81441980416
1 company_name Market capitalization
2 0 SO 81441980416

View file

@ -0,0 +1,2 @@
,company_name,Market capitalization
0,SPGI,113970610176
1 company_name Market capitalization
2 0 SPGI 113970610176

View file

@ -0,0 +1,2 @@
,company_name,Market capitalization
0,SPG,39859634176
1 company_name Market capitalization
2 0 SPG 39859634176

View file

@ -0,0 +1,2 @@
,company_name,Market capitalization
0,TGT,72657674240
1 company_name Market capitalization
2 0 TGT 72657674240

View file

@ -0,0 +1,2 @@
,company_name,Market capitalization
0,TMO,206229569536
1 company_name Market capitalization
2 0 TMO 206229569536

View file

@ -0,0 +1,2 @@
,company_name,Market capitalization
0,TMUS,170420387840
1 company_name Market capitalization
2 0 TMUS 170420387840

View file

@ -0,0 +1,2 @@
,company_name,Market capitalization
0,TSLA,536120885248
1 company_name Market capitalization
2 0 TSLA 536120885248

View file

@ -0,0 +1,2 @@
,company_name,Market capitalization
0,TXN,147947601920
1 company_name Market capitalization
2 0 TXN 147947601920

View file

@ -0,0 +1,2 @@
,company_name,Market capitalization
0,T,121675988992
1 company_name Market capitalization
2 0 T 121675988992

View file

@ -0,0 +1,2 @@
,company_name,Market capitalization
0,UNH,456559460352
1 company_name Market capitalization
2 0 UNH 456559460352

View file

@ -0,0 +1,2 @@
,company_name,Market capitalization
0,UNP,122298712064
1 company_name Market capitalization
2 0 UNP 122298712064

View file

@ -0,0 +1,2 @@
,company_name,Market capitalization
0,UPS,148595867648
1 company_name Market capitalization
2 0 UPS 148595867648

View file

@ -0,0 +1,2 @@
,company_name,Market capitalization
0,USB,45852028928
1 company_name Market capitalization
2 0 USB 45852028928

View file

@ -0,0 +1,2 @@
,company_name,Market capitalization
0,VZ,157943906304
1 company_name Market capitalization
2 0 VZ 157943906304

View file

@ -0,0 +1,2 @@
,company_name,Market capitalization
0,V,488539717632
1 company_name Market capitalization
2 0 V 488539717632

View file

@ -0,0 +1,2 @@
,company_name,Market capitalization
0,WFC,144610557952
1 company_name Market capitalization
2 0 WFC 144610557952

View file

@ -0,0 +1,2 @@
,company_name,Market capitalization
0,WMT,413342760960
1 company_name Market capitalization
2 0 WMT 413342760960

View file

@ -0,0 +1,2 @@
,company_name,Market capitalization
0,XOM,441373097984
1 company_name Market capitalization
2 0 XOM 441373097984

10
scraper/marketcap.py Normal file
View file

@ -0,0 +1,10 @@
from yahooquery import Ticker
stock_symbol = 'AAPL' # Replace with your desired stock symbol
ticker = Ticker(stock_symbol)
summary = ticker.summary_detail
market_cap = summary[stock_symbol.upper()]['marketCap']
print("Market Cap:", market_cap)

View file

@ -13,9 +13,20 @@ import yfinance as yf
from yahoo_fin import stock_info as si
def get_market_cap(ticker1):
def get_analyst_estimates(ticker_symbol):
estimates = si.get_analysts_info(ticker_symbol)
ticker = Ticker(ticker1)
summary = ticker.summary_detail
market_cap = summary[ticker1.upper()]['marketCap']
return market_cap
def get_analyst_estimates(ticker):
estimates = si.get_analysts_info(ticker)
next_5_years_estimates = estimates["Growth Estimates"].iloc[4].dropna()
return next_5_years_estimates[1]
@ -92,6 +103,13 @@ def get_stock_data(ticker):
'5Y Growth estimate': [estimated_growth]
})
market_cap = get_market_cap(ticker)
market_cap_file = pd.DataFrame({
'company_name': [ticker],
'Market capitalization': [market_cap]
})
ratios_components = ['asOfDate', 'PeRatio',
'PegRatio', 'PsRatio', 'PbRatio']
balance_sheet_components = ['asOfDate', 'CurrentAssets',
@ -112,6 +130,7 @@ def get_stock_data(ticker):
balance_sheet_data.to_csv(os.path.join(folder_name, ticker + "_balance_sheet_4Y+4Q.csv"))
company_data.to_csv(os.path.join(folder_name, ticker + "meta_data.csv"))
earnings_next5Y.to_csv(os.path.join(folder_name, ticker + "5YGrowthEstimates.csv"))
market_cap_file.to_csv(os.path.join(folder_name, ticker + "MarketCap.csv"))