Automate the collection of ESG rating with Python

Automate the collection of ESG rating with Python

2021, Dec 26    

What is ESG

ESG is the acronym for Environmental, Social, and (Corporate) Governance, the three broad categories, or areas, of interest for what is termed “socially responsible investors.” They are investors who consider it important to incorporate their values and concerns (such as environmental concerns) into their selection of investments instead of simply considering the potential profitability and/or risk presented by an investment opportunity. The Financial Times Lexicon defines ESG as “a generic term used in capital markets and used by investors to evaluate corporate behaviour and to determine the future financial performance of companies.”

ESG score

An organisation’s ESG score is, simply put, a numerical measure of how it is perceived to be performing on a wide range of environmental, social and governance (ESG) topics. With the growing need to quantify a business’s ESG performance, different scoring systems have emerged. Analysis companies offering various calculation processes are offering to create bespoke ESG scores for clients, but, just as ESG scoring is the measurement of perception rather than reality, so ESG data systems can be largely subjective.

A reliable scoring system needs to be objective, accurate and consistent. It should be able to provide comparable scores for businesses across sectors and geographies. It should encompass the perceptions of all stakeholders.

MSCI ESG rating

MSCI Inc., is an American finance company headquartered in New York City and serving as a global provider of equity, fixed income, hedge fund stock market indexes, multi-asset portfolio analysis tools and ESG products.

ESG Risk Ratings provided by MSCI are designed to measure a company’s resilience to long-term, industry material environmental, social and governance (ESG) risks. MSCI uses a rules-based methodology to identify industry leaders and laggards according to their exposure to ESG risks and how well they manage those risks relative to peers. You can find the full expalanation of their ESG ratings methodology in this link.

Get MSCI risk rating by python

ESG risk ratings play an important role in stock market analysis, and previously, the only way of obtaining this data from MSCI was to open the Search Tool in a browser, search for a symbol, and click on one of the autosuggested results. With using a python package called “py-msci-esg” we can automate the collection of the important ESG risk rating data. This is a simple package that uses “Selenium” to scrape content from the MSCI ESG Risk Corporate Search Tool and returns the results in JSON format. The following piece of python code shows how we can get the ESG rating of ROYAL DUTCH SHELL plc.

from msci_esg.ratefinder import ESGRateFinder

# Create an ESGRateFinder object, optionally passing in debug=True for more print statements
ratefinder = ESGRateFinder()

# Call the ratefinder object's get_esg_rating method, passing in the Apple stock symbol and 
# a JS timeout of 5 seconds (this is how long the Selenium web driver should wait for JS to execute 
# before scraping content)
response = ratefinder.get_esg_rating(
    symbol="SHELL",
    js_timeout=5
)
# The response is a dictionary; print it
print(response)

The result will look like the following:

{'rating-paragraph': 'Shell is a leader among 28 companies in the integrated oil & gas industry.', 'rating-history-paragraph': 'Shell was upgraded in September, 2021.', 'current': {'esg_rating': 'aa', 'esg_category': 'leader'}}

figure1