Skip to content

Commit

Permalink
Initial commit
Browse files Browse the repository at this point in the history
  • Loading branch information
Julius committed May 28, 2021
0 parents commit bf0903d
Show file tree
Hide file tree
Showing 3,041 changed files with 945,687 additions and 0 deletions.
The diff you're trying to view is too large. We only load the first 3000 changed files.
Empty file added .idea/.gitignore
Empty file.
6 changes: 6 additions & 0 deletions .idea/inspectionProfiles/profiles_settings.xml

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

4 changes: 4 additions & 0 deletions .idea/misc.xml

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

8 changes: 8 additions & 0 deletions .idea/modules.xml

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

126 changes: 126 additions & 0 deletions .idea/workspace.xml

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

10 changes: 10 additions & 0 deletions .idea/yesg.iml

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

7 changes: 7 additions & 0 deletions LICENSE.txt
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
Copyright 2021 Julius Langer

Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions:

The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software.

THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
88 changes: 88 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,88 @@
Yahoo ESG Scores for Python
=============================

This module retrieves esg scores and other sustainability information about a company from the yahoo finance website.

**Warning: The retrieved data might be outdated. Use at your own risk.**

Installation
------------

You can install the library by using:
``` {.sourceCode .bash}
pip install yesg
```

Import
------

``` {.sourceCode .python}
import yesg
```


Get ESG scores and sustainability data
--------------------------------------
To download all available sustainability information for a company, simply use this:

``` {.sourceCode .python}
# All sustainability information about THE BOEING COMPANY
print(yesg.get_esg_full('BA').to_string())
```

```{r, engine='python', count_lines}
OUTPUT:
Ticker Total-Score E-Score S-Score G-Score Last Rated ESG Performance peer Group Highest Controversy peer Count total Percentile environment Percentile social Percentile governance Percentile related Controversy min peer ESG avg peer ESG max peer ESG min peer Environment avg peer Environment max peer Environment min peer Social avg peer Social max peer Social min peer Governance avg peer Governance max peer Governance min Highest Controversy avg Highest Controversy max Highest Controversy Controversial Business Areas
0 BA 36.6 8.1 19.7 8.8 May 2021 OUT_PERF Aerospace & Defense 4.0 24 78.79 None None None Customer Incidents 24.07 32.06 39.54 5.27 8.631667 11.21 9.94 16.0825 20.83 4.76 7.344583 10.08 0.0 2.416667 4.0 Controversial Weapons, Military Contracting,
```


Only get ESG scores
--------------------------------------
To only download the quantitative ESG risk rating of a company, use can use this:
``` {.sourceCode .python}
# ESG risk rating from THE BOEING COMPANY
print(yesg.get_esg_short('BA').to_string())
```

```{r, engine='python', count_lines}
OUTPUT:
Ticker Total-Score E-Score S-Score G-Score Last Rated
0 BA 36.6 8.1 19.7 8.8 May 2021
```


Return description
-----------------

Yahoo gets it data from Sustainalytics. They describe their ratings as follows: \
*"The ESG Risk Ratings measure the degree to which a company’s economic value is at risk driven by ESG factors or, more technically speaking, the magnitude of a company’s unmanaged ESG risks. "*

→ **The lower the rating, the more sustainable a company is**

The dataframe consists of:
- **Ticker** - Ticker symbol of the company
- **Total-Score** - Overall ESG risk rating
- **E-Score** - Environmental risk rating of a company
- **S-Score** - Social risk rating of a company
- **G-Score** - Governance risk rating of a company
- **Last Rated** - The month in which the rating was updated


- **ESG Performance** - Verbal description of the ESG performance. Translates to 'Negligible' (LAG_PERF), 'Low' (UND_PERF), 'Medium' (AVG_PERF), 'High' (OUT_PERF) and 'Severe' (LEAD_PERF)
- **peer Group** - Sector of the company
- **Highest Controversy** - The Highest controversy of the company, compared to the peer group
- **peer Count** - Size of the peer group
- **total Percentile** - Percentile of the overall ESG risk rating
- **environment Percentile** - Percentile of the environmental risk rating
- **social Percentile** - Percentile of the social risk rating
- **governance Percentile** - Percentile of the governance risk rating
- **related Controversy** - Controversies the company was involved in
- **peer ESG** - min/avg/max overall risk rating within the peer group
- **peer Environment** - min/avg/max environmental risk rating within the peer group
- **peer Social** - min/avg/max social risk rating within the peer group
- **peer Governance** - min/avg/max governance risk rating within the peer group
- **Highest Controversy** - min/avg/max of the highest controversy within the peer group
- **Controversial Business Areas** - Controversial business areas in which the company is involved


Binary file added dist/yesg-1.0.0.tar.gz
Binary file not shown.
2 changes: 2 additions & 0 deletions setup.cfg
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
[metadata]
description-file = README.md
43 changes: 43 additions & 0 deletions setup.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,43 @@
from setuptools import setup, find_packages
import pathlib

here = pathlib.Path(__file__).parent.resolve()

long_description = (here / 'README.md').read_text(encoding='utf-8')

setup(
name='yesg',

version='1.0.0',

description='This module downloads esg scores for stocks from Yahoo Finance.',

long_description=long_description,

long_description_content_type='text/markdown',

url='https://github.com/Lienus10/yesg',

author='Julius Langer',

author_email='julius.langer@outlook.de',

classifiers=[
'Development Status :: 3 - Alpha',

'Topic :: Office/Business :: Financial :: Investment',

'License :: OSI Approved :: MIT License',

'Programming Language :: Python :: 3',
'Programming Language :: Python :: 3.6',
'Programming Language :: Python :: 3.7',
'Programming Language :: Python :: 3.8',
'Programming Language :: Python :: 3.9',
],

packages=find_packages(),

python_requires='>=3.6, <4',

)
Loading

0 comments on commit bf0903d

Please sign in to comment.