yfrake.openapi.modules.esg_scores   A
last analyzed

Complexity

Total Complexity 0

Size/Duplication

Total Lines 117
Duplicated Lines 0 %

Importance

Changes 0
Metric Value
eloc 72
dl 0
loc 117
rs 10
c 0
b 0
f 0
wmc 0
1
# ================================================================================== #
2
#   esg_scores.py - This file is part of the yfrake package.                         #
3
# ================================================================================== #
4
#                                                                                    #
5
#   MIT License                                                                      #
6
#                                                                                    #
7
#   Copyright (c) 2022 Mattias Aabmets                                               #
8
#                                                                                    #
9
#   Permission is hereby granted, free of charge, to any person obtaining a copy     #
10
#   of this software and associated documentation files (the "Software"), to deal    #
11
#   in the Software without restriction, including without limitation the rights     #
12
#   to use, copy, modify, merge, publish, distribute, sublicense, and/or sell        #
13
#   copies of the Software, and to permit persons to whom the Software is            #
14
#   furnished to do so, subject to the following conditions:                         #
15
#                                                                                    #
16
#   The above copyright notice and this permission notice shall be included in all   #
17
#   copies or substantial portions of the Software.                                  #
18
#                                                                                    #
19
#   THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR       #
20
#   IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,         #
21
#   FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE      #
22
#   AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER           #
23
#   LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,    #
24
#   OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE    #
25
#   SOFTWARE.                                                                        #
26
#                                                                                    #
27
# ================================================================================== #
28
summary = 'ESG Scores'
29
description = 'Returns current ESG scores of a security identifier and its peer group.'
30
31
# ---------------------------------------------------------------------------------- #
32
parameters = [
33
    {
34
        'name': 'symbol',
35
        'description': 'Any valid equity security identifier.',
36
        'required': True,
37
        'in': 'query',
38
        'schema': {
39
            'type': str
40
        }
41
    }
42
]
43
44
# ---------------------------------------------------------------------------------- #
45
response = {
46
    'maxAge': int,
47
    'totalEsg': {
48
        'raw': float,
49
        'fmt': str
50
    },
51
    'environmentScore': {
52
        'raw': float,
53
        'fmt': str
54
    },
55
    'socialScore': {
56
        'raw': float,
57
        'fmt': str
58
    },
59
    'governanceScore': {
60
        'raw': float,
61
        'fmt': str
62
    },
63
    'ratingYear': int,
64
    'ratingMonth': int,
65
    'highestControversy': float,
66
    'peerCount': int,
67
    'esgPerformance': str,
68
    'peerGroup': str,
69
    'relatedControversy': list,
70
    'peerEsgScorePerformance': {
71
        'min': float,
72
        'avg': float,
73
        'max': float
74
    },
75
    'peerGovernancePerformance': {
76
        'min': float,
77
        'avg': float,
78
        'max': float
79
    },
80
    'peerSocialPerformance': {
81
        'min': float,
82
        'avg': float,
83
        'max': float
84
    },
85
    'peerEnvironmentPerformance': {
86
        'min': float,
87
        'avg': float,
88
        'max': float
89
    },
90
    'peerHighestControversyPerformance': {
91
        'min': float,
92
        'avg': float,
93
        'max': float
94
    },
95
    'percentile': {
96
        'raw': float,
97
        'fmt': str
98
    },
99
    'environmentPercentile': float,
100
    'socialPercentile': float,
101
    'governancePercentile': float,
102
    'adult': bool,
103
    'alcoholic': bool,
104
    'animalTesting': bool,
105
    'catholic': bool,
106
    'controversialWeapons': bool,
107
    'smallArms': bool,
108
    'furLeather': bool,
109
    'gambling': bool,
110
    'gmo': bool,
111
    'militaryContract': bool,
112
    'nuclear': bool,
113
    'pesticides': bool,
114
    'palmOil': bool,
115
    'coal': bool,
116
    'tobacco': bool
117
}
118