yfrake.openapi.modules.financials   A
last analyzed

Complexity

Total Complexity 0

Size/Duplication

Total Lines 165
Duplicated Lines 0 %

Importance

Changes 0
Metric Value
eloc 103
dl 0
loc 165
rs 10
c 0
b 0
f 0
wmc 0
1
# ================================================================================== #
2
#   financials.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 = 'Financials'
29
description = 'Returns the financials of a security identifier.'
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
    'currentPrice': {
48
        'raw': float,
49
        'fmt': str
50
    },
51
    'targetHighPrice': {
52
        'raw': float,
53
        'fmt': str
54
    },
55
    'targetLowPrice': {
56
        'raw': float,
57
        'fmt': str
58
    },
59
    'targetMeanPrice': {
60
        'raw': float,
61
        'fmt': str
62
    },
63
    'targetMedianPrice': {
64
        'raw': float,
65
        'fmt': str
66
    },
67
    'recommendationMean': {
68
        'raw': float,
69
        'fmt': str
70
    },
71
    'recommendationKey': str,
72
    'numberOfAnalystOpinions': {
73
        'raw': int,
74
        'fmt': str,
75
        'longFmt': str
76
    },
77
    'totalCash': {
78
        'raw': int,
79
        'fmt': str,
80
        'longFmt': str
81
    },
82
    'totalCashPerShare': {
83
        'raw': float,
84
        'fmt': str
85
    },
86
    'ebitda': {
87
        'raw': int,
88
        'fmt': str,
89
        'longFmt': str
90
    },
91
    'totalDebt': {
92
        'raw': int,
93
        'fmt': str,
94
        'longFmt': str
95
    },
96
    'quickRatio': {
97
        'raw': float,
98
        'fmt': str
99
    },
100
    'currentRatio': {
101
        'raw': float,
102
        'fmt': str
103
    },
104
    'totalRevenue': {
105
        'raw': int,
106
        'fmt': str,
107
        'longFmt': str
108
    },
109
    'debtToEquity': {
110
        'raw': float,
111
        'fmt': str
112
    },
113
    'revenuePerShare': {
114
        'raw': float,
115
        'fmt': str
116
    },
117
    'returnOnAssets': {
118
        'raw': float,
119
        'fmt': str
120
    },
121
    'returnOnEquity': {
122
        'raw': float,
123
        'fmt': str
124
    },
125
    'grossProfits': {
126
        'raw': int,
127
        'fmt': str,
128
        'longFmt': str
129
    },
130
    'freeCashflow': {
131
        'raw': int,
132
        'fmt': str,
133
        'longFmt': str
134
    },
135
    'operatingCashflow': {
136
        'raw': int,
137
        'fmt': str,
138
        'longFmt': str
139
    },
140
    'earningsGrowth': {
141
        'raw': float,
142
        'fmt': str
143
    },
144
    'revenueGrowth': {
145
        'raw': float,
146
        'fmt': str
147
    },
148
    'grossMargins': {
149
        'raw': float,
150
        'fmt': str
151
    },
152
    'ebitdaMargins': {
153
        'raw': float,
154
        'fmt': str
155
    },
156
    'operatingMargins': {
157
        'raw': float,
158
        'fmt': str
159
    },
160
    'profitMargins': {
161
        'raw': float,
162
        'fmt': str
163
    },
164
    'financialCurrency': str
165
}
166