It would be handy to have Global Industry Classification Standard codes available. This code demonstrates it’s not neccessarily standard:
>>> import yfinance as yf
>>> symbol = "BHP"
>>> exchange = "ASX"
>>> exchange_code = ".AX"
>>> stock = yf.Ticker(symbol + exchange_code)
>>> stock.info['symbol']
'BHP.AX'
>>>
>>>
>>> stock.info['quoteType']
'EQUITY'
>>> stock.info['sector']
'Basic Materials'
>>> stock.info['industry']
'Other Industrial Metals & Mining'
>>> stock.info['market']
'au_market'