1
|
|
|
# ================================================================================== # |
2
|
|
|
# balance_statements.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 = 'Balance Statements' |
29
|
|
|
description = 'Returns the balance statements 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
|
|
|
'balance_yearly': [ |
47
|
|
|
{ |
48
|
|
|
'maxAge': int, |
49
|
|
|
'endDate': { |
50
|
|
|
'raw': int, |
51
|
|
|
'fmt': str |
52
|
|
|
}, |
53
|
|
|
'cash': { |
54
|
|
|
'raw': int, |
55
|
|
|
'fmt': str, |
56
|
|
|
'longFmt': str |
57
|
|
|
}, |
58
|
|
|
'shortTermInvestments': { |
59
|
|
|
'raw': int, |
60
|
|
|
'fmt': str, |
61
|
|
|
'longFmt': str |
62
|
|
|
}, |
63
|
|
|
'netReceivables': { |
64
|
|
|
'raw': int, |
65
|
|
|
'fmt': str, |
66
|
|
|
'longFmt': str |
67
|
|
|
}, |
68
|
|
|
'inventory': { |
69
|
|
|
'raw': int, |
70
|
|
|
'fmt': str, |
71
|
|
|
'longFmt': str |
72
|
|
|
}, |
73
|
|
|
'otherCurrentAssets': { |
74
|
|
|
'raw': int, |
75
|
|
|
'fmt': str, |
76
|
|
|
'longFmt': str |
77
|
|
|
}, |
78
|
|
|
'totalCurrentAssets': { |
79
|
|
|
'raw': int, |
80
|
|
|
'fmt': str, |
81
|
|
|
'longFmt': str |
82
|
|
|
}, |
83
|
|
|
'longTermInvestments': { |
84
|
|
|
'raw': int, |
85
|
|
|
'fmt': str, |
86
|
|
|
'longFmt': str |
87
|
|
|
}, |
88
|
|
|
'propertyPlantEquipment': { |
89
|
|
|
'raw': int, |
90
|
|
|
'fmt': str, |
91
|
|
|
'longFmt': str |
92
|
|
|
}, |
93
|
|
|
'goodWill': { |
94
|
|
|
'raw': int, |
95
|
|
|
'fmt': str, |
96
|
|
|
'longFmt': str |
97
|
|
|
}, |
98
|
|
|
'intangibleAssets': { |
99
|
|
|
'raw': int, |
100
|
|
|
'fmt': str, |
101
|
|
|
'longFmt': str |
102
|
|
|
}, |
103
|
|
|
'otherAssets': { |
104
|
|
|
'raw': int, |
105
|
|
|
'fmt': str, |
106
|
|
|
'longFmt': str |
107
|
|
|
}, |
108
|
|
|
'deferredLongTermAssetCharges': { |
109
|
|
|
'raw': int, |
110
|
|
|
'fmt': str, |
111
|
|
|
'longFmt': str |
112
|
|
|
}, |
113
|
|
|
'totalAssets': { |
114
|
|
|
'raw': int, |
115
|
|
|
'fmt': str, |
116
|
|
|
'longFmt': str |
117
|
|
|
}, |
118
|
|
|
'accountsPayable': { |
119
|
|
|
'raw': int, |
120
|
|
|
'fmt': str, |
121
|
|
|
'longFmt': str |
122
|
|
|
}, |
123
|
|
|
'shortLongTermDebt': { |
124
|
|
|
'raw': int, |
125
|
|
|
'fmt': str, |
126
|
|
|
'longFmt': str |
127
|
|
|
}, |
128
|
|
|
'otherCurrentLiab': { |
129
|
|
|
'raw': int, |
130
|
|
|
'fmt': str, |
131
|
|
|
'longFmt': str |
132
|
|
|
}, |
133
|
|
|
'longTermDebt': { |
134
|
|
|
'raw': int, |
135
|
|
|
'fmt': str, |
136
|
|
|
'longFmt': str |
137
|
|
|
}, |
138
|
|
|
'otherLiab': { |
139
|
|
|
'raw': int, |
140
|
|
|
'fmt': str, |
141
|
|
|
'longFmt': str |
142
|
|
|
}, |
143
|
|
|
'totalCurrentLiabilities': { |
144
|
|
|
'raw': int, |
145
|
|
|
'fmt': str, |
146
|
|
|
'longFmt': str |
147
|
|
|
}, |
148
|
|
|
'totalLiab': { |
149
|
|
|
'raw': int, |
150
|
|
|
'fmt': str, |
151
|
|
|
'longFmt': str |
152
|
|
|
}, |
153
|
|
|
'commonStock': { |
154
|
|
|
'raw': int, |
155
|
|
|
'fmt': str, |
156
|
|
|
'longFmt': str |
157
|
|
|
}, |
158
|
|
|
'retainedEarnings': { |
159
|
|
|
'raw': int, |
160
|
|
|
'fmt': str, |
161
|
|
|
'longFmt': str |
162
|
|
|
}, |
163
|
|
|
'treasuryStock': { |
164
|
|
|
'raw': int, |
165
|
|
|
'fmt': str, |
166
|
|
|
'longFmt': str |
167
|
|
|
}, |
168
|
|
|
'otherStockholderEquity': { |
169
|
|
|
'raw': int, |
170
|
|
|
'fmt': str, |
171
|
|
|
'longFmt': str |
172
|
|
|
}, |
173
|
|
|
'totalStockholderEquity': { |
174
|
|
|
'raw': int, |
175
|
|
|
'fmt': str, |
176
|
|
|
'longFmt': str |
177
|
|
|
}, |
178
|
|
|
'netTangibleAssets': { |
179
|
|
|
'raw': int, |
180
|
|
|
'fmt': str, |
181
|
|
|
'longFmt': str |
182
|
|
|
} |
183
|
|
|
} |
184
|
|
|
], |
185
|
|
|
'balance_quarterly': [ |
186
|
|
|
{ |
187
|
|
|
'maxAge': int, |
188
|
|
|
'endDate': { |
189
|
|
|
'raw': int, |
190
|
|
|
'fmt': str |
191
|
|
|
}, |
192
|
|
|
'cash': { |
193
|
|
|
'raw': int, |
194
|
|
|
'fmt': str, |
195
|
|
|
'longFmt': str |
196
|
|
|
}, |
197
|
|
|
'shortTermInvestments': { |
198
|
|
|
'raw': int, |
199
|
|
|
'fmt': str, |
200
|
|
|
'longFmt': str |
201
|
|
|
}, |
202
|
|
|
'netReceivables': { |
203
|
|
|
'raw': int, |
204
|
|
|
'fmt': str, |
205
|
|
|
'longFmt': str |
206
|
|
|
}, |
207
|
|
|
'inventory': { |
208
|
|
|
'raw': int, |
209
|
|
|
'fmt': str, |
210
|
|
|
'longFmt': str |
211
|
|
|
}, |
212
|
|
|
'otherCurrentAssets': { |
213
|
|
|
'raw': int, |
214
|
|
|
'fmt': str, |
215
|
|
|
'longFmt': str |
216
|
|
|
}, |
217
|
|
|
'totalCurrentAssets': { |
218
|
|
|
'raw': int, |
219
|
|
|
'fmt': str, |
220
|
|
|
'longFmt': str |
221
|
|
|
}, |
222
|
|
|
'longTermInvestments': { |
223
|
|
|
'raw': int, |
224
|
|
|
'fmt': str, |
225
|
|
|
'longFmt': str |
226
|
|
|
}, |
227
|
|
|
'propertyPlantEquipment': { |
228
|
|
|
'raw': int, |
229
|
|
|
'fmt': str, |
230
|
|
|
'longFmt': str |
231
|
|
|
}, |
232
|
|
|
'goodWill': { |
233
|
|
|
'raw': int, |
234
|
|
|
'fmt': str, |
235
|
|
|
'longFmt': str |
236
|
|
|
}, |
237
|
|
|
'intangibleAssets': { |
238
|
|
|
'raw': int, |
239
|
|
|
'fmt': str, |
240
|
|
|
'longFmt': str |
241
|
|
|
}, |
242
|
|
|
'otherAssets': { |
243
|
|
|
'raw': int, |
244
|
|
|
'fmt': str, |
245
|
|
|
'longFmt': str |
246
|
|
|
}, |
247
|
|
|
'totalAssets': { |
248
|
|
|
'raw': int, |
249
|
|
|
'fmt': str, |
250
|
|
|
'longFmt': str |
251
|
|
|
}, |
252
|
|
|
'accountsPayable': { |
253
|
|
|
'raw': int, |
254
|
|
|
'fmt': str, |
255
|
|
|
'longFmt': str |
256
|
|
|
}, |
257
|
|
|
'shortLongTermDebt': { |
258
|
|
|
'raw': int, |
259
|
|
|
'fmt': str, |
260
|
|
|
'longFmt': str |
261
|
|
|
}, |
262
|
|
|
'otherCurrentLiab': { |
263
|
|
|
'raw': int, |
264
|
|
|
'fmt': str, |
265
|
|
|
'longFmt': str |
266
|
|
|
}, |
267
|
|
|
'longTermDebt': { |
268
|
|
|
'raw': int, |
269
|
|
|
'fmt': str, |
270
|
|
|
'longFmt': str |
271
|
|
|
}, |
272
|
|
|
'otherLiab': { |
273
|
|
|
'raw': int, |
274
|
|
|
'fmt': str, |
275
|
|
|
'longFmt': str |
276
|
|
|
}, |
277
|
|
|
'totalCurrentLiabilities': { |
278
|
|
|
'raw': int, |
279
|
|
|
'fmt': str, |
280
|
|
|
'longFmt': str |
281
|
|
|
}, |
282
|
|
|
'totalLiab': { |
283
|
|
|
'raw': int, |
284
|
|
|
'fmt': str, |
285
|
|
|
'longFmt': str |
286
|
|
|
}, |
287
|
|
|
'commonStock': { |
288
|
|
|
'raw': int, |
289
|
|
|
'fmt': str, |
290
|
|
|
'longFmt': str |
291
|
|
|
}, |
292
|
|
|
'retainedEarnings': { |
293
|
|
|
'raw': int, |
294
|
|
|
'fmt': str, |
295
|
|
|
'longFmt': str |
296
|
|
|
}, |
297
|
|
|
'treasuryStock': { |
298
|
|
|
'raw': int, |
299
|
|
|
'fmt': str, |
300
|
|
|
'longFmt': str |
301
|
|
|
}, |
302
|
|
|
'otherStockholderEquity': { |
303
|
|
|
'raw': int, |
304
|
|
|
'fmt': str, |
305
|
|
|
'longFmt': str |
306
|
|
|
}, |
307
|
|
|
'totalStockholderEquity': { |
308
|
|
|
'raw': int, |
309
|
|
|
'fmt': str, |
310
|
|
|
'longFmt': str |
311
|
|
|
}, |
312
|
|
|
'netTangibleAssets': { |
313
|
|
|
'raw': int, |
314
|
|
|
'fmt': str, |
315
|
|
|
'longFmt': str |
316
|
|
|
} |
317
|
|
|
} |
318
|
|
|
] |
319
|
|
|
} |
320
|
|
|
|