Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Feature Proposal: Support Sector and Industry data from Markets Tab #2058

Open
wants to merge 1 commit into
base: dev
Choose a base branch
from

Conversation

ericpien
Copy link
Contributor

@ericpien ericpien commented Sep 18, 2024

The following data is available on: https://finance.yahoo.com/sectors/:

  • sector / industry overview
  • sector / industry top companies
  • sector / industry research reports
  • sector top ETFs
  • sector top Mutual Funds
  • industries within sector
  • industry's sector
  • industry's top performing companies
  • industry's top growth companies

Resolves:

Sample code:

import yfinance as yf
tech = yf.Sector('technology')
software = yf.Industry('software-infrastructure')

# Common information
tech.key
tech.name
tech.symbol
tech.ticker
tech.overview
tech.top_companies
tech.research_reports

# Sector information
tech.top_etfs
tech.top_mutual_funds
tech.industries

# Industry information
software.sector_key
software.sector_name
software.top_performing_companies
software.top_growth_companies

# Ticker to Sector and Industry
msft = yf.Ticker('MSFT')
tech = yf.Sector(msft.info.get('sectorKey'))
software = yf.Industry(msft.info.get('industryKey'))

# Sector and Industry to Ticker
tech_ticker = tech.ticker
tech_ticker.info
software_ticker = software.ticker
software_ticker.history()

@ericpien ericpien marked this pull request as ready for review September 18, 2024 15:24
@sshcli
Copy link

sshcli commented Sep 18, 2024

Thank you @ericpien 🙌

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants