Sector#
- class yfinance.Sector(key, session=None)#
Represents a financial market sector and allows retrieval of sector-related data such as top ETFs, top mutual funds, and industry data.
- Parameters:
key (str) – The key representing the sector.
session (requests.Session, optional) – A session for making requests. Defaults to None.
See also
Sector.industriesMap of sector and industry
Attributes
- industries
Gets the industries within the sector.
- Returns:
A DataFrame with industries’ key, name, symbol, and market weight.
- Return type:
pandas.DataFrame
Permitted Keys/Values# Key
Values
basic-materials
agricultural-inputs
aluminum
building-materials
chemicals
coking-coal
copper
gold
lumber-wood-production
other-industrial-metals-mining
other-precious-metals-mining
paper-paper-products
silver
specialty-chemicals
steel
communication-services
advertising-agencies
broadcasting
electronic-gaming-multimedia
entertainment
internet-content-information
publishing
telecom-services
consumer-cyclical
apparel-manufacturing
apparel-retail
auto-manufacturers
auto-parts
auto-truck-dealerships
department-stores
footwear-accessories
furnishings-fixtures-appliances
gambling
home-improvement-retail
internet-retail
leisure
lodging
luxury-goods
packaging-containers
personal-services
recreational-vehicles
residential-construction
resorts-casinos
restaurants
specialty-retail
textile-manufacturing
travel-services
consumer-defensive
beverages—brewers
beverages—non-alcoholic
beverages—wineries-distilleries
confectioners
discount-stores
education-training-services
farm-products
food-distribution
grocery-stores
household-personal-products
packaged-foods
tobacco
energy
oil-gas-drilling
oil-gas-e&p
oil-gas-equipment-services
oil-gas-integrated
oil-gas-midstream
oil-gas-refining-marketing
thermal-coal
uranium
financial-services
asset-management
banks—diversified
banks—regional
capital-markets
credit-services
financial-conglomerates
financial-data-stock-exchanges
insurance-brokers
insurance—diversified
insurance—life
insurance—property-casualty
insurance—reinsurance
insurance—specialty
mortgage-finance
shell-companies
healthcare
biotechnology
diagnostics-research
drug-manufacturers—general
drug-manufacturers—specialty-generic
health-information-services
healthcare-plans
medical-care-facilities
medical-devices
medical-distribution
medical-instruments-supplies
pharmaceutical-retailers
industrials
aerospace-defense
airlines
airports-air-services
building-products-equipment
business-equipment-supplies
conglomerates
consulting-services
electrical-equipment-parts
engineering-construction
farm-heavy-construction-machinery
industrial-distribution
infrastructure-operations
integrated-freight-logistics
marine-shipping
metal-fabrication
pollution-treatment-controls
railroads
rental-leasing-services
security-protection-services
specialty-business-services
specialty-industrial-machinery
staffing-employment-services
tools-accessories
trucking
waste-management
real-estate
real-estate-services
real-estate—development
real-estate—diversified
reit—diversified
reit—healthcare-facilities
reit—hotel-motel
reit—industrial
reit—mortgage
reit—office
reit—residential
reit—retail
reit—specialty
technology
communication-equipment
computer-hardware
consumer-electronics
electronic-components
electronics-computer-distribution
information-technology-services
scientific-technical-instruments
semiconductor-equipment-materials
semiconductors
software—application
software—infrastructure
solar
utilities
utilities—diversified
utilities—independent-power-producers
utilities—regulated-electric
utilities—regulated-gas
utilities—regulated-water
utilities—renewable
- key
Retrieves the key of the domain entity.
- Returns:
The unique key of the domain entity.
- Return type:
str
- name
Retrieves the name of the domain entity.
- Returns:
The name of the domain entity.
- Return type:
str
- overview
Retrieves the overview information of the domain entity.
- Returns:
A dictionary containing an overview of the domain entity.
- Return type:
Dict
- research_reports
Retrieves research reports related to the domain entity.
- Returns:
A list of research reports, where each report is a dictionary with metadata.
- Return type:
List[Dict[str, str]]
- symbol
Retrieves the symbol of the domain entity.
- Returns:
The symbol representing the domain entity.
- Return type:
str
- ticker
Retrieves a Ticker object based on the domain entity’s symbol.
- Returns:
A Ticker object associated with the domain entity.
- Return type:
- top_companies
Retrieves the top companies within the domain entity.
- Returns:
A DataFrame containing the top companies in the domain.
- Return type:
pandas.DataFrame
- top_etfs
Gets the top ETFs for the sector.
- Returns:
A dictionary of ETF symbols and names.
- Return type:
Dict[str, str]
- top_mutual_funds
Gets the top mutual funds for the sector.
- Returns:
A dictionary of mutual fund symbols and names.
- Return type:
Dict[str, str]
Methods
- __init__(key, session=None)
- Parameters:
key (str) – The key representing the sector.
session (requests.Session, optional) – A session for making requests. Defaults to None.
See also
Sector.industriesMap of sector and industry