fmp-data 0.0.0__py3-none-any.whl
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- fmp_data/__init__.py +138 -0
- fmp_data/alternative/__init__.py +34 -0
- fmp_data/alternative/client.py +150 -0
- fmp_data/alternative/endpoints.py +533 -0
- fmp_data/alternative/mapping.py +737 -0
- fmp_data/alternative/models.py +296 -0
- fmp_data/alternative/schema.py +165 -0
- fmp_data/base.py +316 -0
- fmp_data/client.py +269 -0
- fmp_data/company/__init__.py +40 -0
- fmp_data/company/client.py +238 -0
- fmp_data/company/endpoints.py +711 -0
- fmp_data/company/hints.py +77 -0
- fmp_data/company/mapping.py +1361 -0
- fmp_data/company/models.py +543 -0
- fmp_data/company/schema.py +132 -0
- fmp_data/config.py +207 -0
- fmp_data/economics/__init__.py +16 -0
- fmp_data/economics/client.py +52 -0
- fmp_data/economics/endpoints.py +164 -0
- fmp_data/economics/mapping.py +641 -0
- fmp_data/economics/models.py +75 -0
- fmp_data/economics/schema.py +91 -0
- fmp_data/exceptions.py +54 -0
- fmp_data/fundamental/__init__.py +40 -0
- fmp_data/fundamental/client.py +87 -0
- fmp_data/fundamental/endpoints.py +403 -0
- fmp_data/fundamental/mapping.py +867 -0
- fmp_data/fundamental/models.py +913 -0
- fmp_data/fundamental/schema.py +40 -0
- fmp_data/institutional/__init__.py +26 -0
- fmp_data/institutional/client.py +141 -0
- fmp_data/institutional/endpoints.py +321 -0
- fmp_data/institutional/mapping.py +749 -0
- fmp_data/institutional/models.py +301 -0
- fmp_data/institutional/schema.py +99 -0
- fmp_data/intelligence/__init__.py +58 -0
- fmp_data/intelligence/client.py +331 -0
- fmp_data/intelligence/endpoints.py +788 -0
- fmp_data/intelligence/mapping.py +1677 -0
- fmp_data/intelligence/models.py +707 -0
- fmp_data/intelligence/schema.py +57 -0
- fmp_data/investment/__init__.py +24 -0
- fmp_data/investment/client.py +104 -0
- fmp_data/investment/endpoints.py +241 -0
- fmp_data/investment/mapping.py +658 -0
- fmp_data/investment/models.py +220 -0
- fmp_data/investment/schema.py +106 -0
- fmp_data/lc/__init__.py +256 -0
- fmp_data/lc/config.py +88 -0
- fmp_data/lc/embedding.py +140 -0
- fmp_data/lc/hints.py +66 -0
- fmp_data/lc/mapping.py +107 -0
- fmp_data/lc/models.py +98 -0
- fmp_data/lc/registry.py +693 -0
- fmp_data/lc/utils.py +35 -0
- fmp_data/lc/validation.py +267 -0
- fmp_data/lc/vector_store.py +592 -0
- fmp_data/logger.py +358 -0
- fmp_data/market/__init__.py +18 -0
- fmp_data/market/client.py +106 -0
- fmp_data/market/endpoints.py +358 -0
- fmp_data/market/hints.py +22 -0
- fmp_data/market/mapping.py +854 -0
- fmp_data/market/models.py +310 -0
- fmp_data/market/schema.py +186 -0
- fmp_data/mcp/__init__.py +0 -0
- fmp_data/mcp/server.py +101 -0
- fmp_data/mcp/tool_loader.py +74 -0
- fmp_data/mcp/tools_manifest.py +17 -0
- fmp_data/models.py +265 -0
- fmp_data/rate_limit.py +136 -0
- fmp_data/schema.py +158 -0
- fmp_data/technical/__init__.py +28 -0
- fmp_data/technical/client.py +214 -0
- fmp_data/technical/endpoints.py +102 -0
- fmp_data/technical/mapping.py +452 -0
- fmp_data/technical/models.py +87 -0
- fmp_data/technical/schema.py +261 -0
- fmp_data-0.0.0.dist-info/METADATA +732 -0
- fmp_data-0.0.0.dist-info/RECORD +84 -0
- fmp_data-0.0.0.dist-info/WHEEL +4 -0
- fmp_data-0.0.0.dist-info/entry_points.txt +10 -0
- fmp_data-0.0.0.dist-info/licenses/LICENSE +21 -0
|
@@ -0,0 +1,358 @@
|
|
|
1
|
+
# fmp_data/market/endpoints.py
|
|
2
|
+
from fmp_data.market.models import (
|
|
3
|
+
AvailableIndex,
|
|
4
|
+
CIKResult,
|
|
5
|
+
CompanySearchResult,
|
|
6
|
+
CUSIPResult,
|
|
7
|
+
ExchangeSymbol,
|
|
8
|
+
ISINResult,
|
|
9
|
+
MarketHours,
|
|
10
|
+
MarketMover,
|
|
11
|
+
PrePostMarketQuote,
|
|
12
|
+
SectorPerformance,
|
|
13
|
+
)
|
|
14
|
+
from fmp_data.market.schema import (
|
|
15
|
+
AvailableIndexesArgs,
|
|
16
|
+
BaseExchangeArg,
|
|
17
|
+
BaseSearchArg,
|
|
18
|
+
ETFListArgs,
|
|
19
|
+
SearchArgs,
|
|
20
|
+
StockListArgs,
|
|
21
|
+
)
|
|
22
|
+
from fmp_data.models import (
|
|
23
|
+
APIVersion,
|
|
24
|
+
CompanySymbol,
|
|
25
|
+
Endpoint,
|
|
26
|
+
EndpointParam,
|
|
27
|
+
HTTPMethod,
|
|
28
|
+
ParamLocation,
|
|
29
|
+
ParamType,
|
|
30
|
+
ShareFloat,
|
|
31
|
+
URLType,
|
|
32
|
+
)
|
|
33
|
+
|
|
34
|
+
STOCK_LIST: Endpoint = Endpoint(
|
|
35
|
+
name="stock_list",
|
|
36
|
+
path="stock/list",
|
|
37
|
+
version=APIVersion.V3,
|
|
38
|
+
url_type=URLType.API,
|
|
39
|
+
method=HTTPMethod.GET,
|
|
40
|
+
description=(
|
|
41
|
+
"Get a comprehensive list of all available stocks with their basic information "
|
|
42
|
+
"including symbol, name, price, and exchange details. Returns the complete "
|
|
43
|
+
"universe of tradable stocks."
|
|
44
|
+
),
|
|
45
|
+
mandatory_params=[],
|
|
46
|
+
optional_params=[],
|
|
47
|
+
response_model=CompanySymbol,
|
|
48
|
+
arg_model=StockListArgs,
|
|
49
|
+
example_queries=[
|
|
50
|
+
"Get a list of all available stocks",
|
|
51
|
+
"Show me all tradable company symbols",
|
|
52
|
+
"What stocks are available for trading?",
|
|
53
|
+
"List all company tickers",
|
|
54
|
+
"Get the complete list of stocks",
|
|
55
|
+
],
|
|
56
|
+
)
|
|
57
|
+
|
|
58
|
+
ETF_LIST: Endpoint = Endpoint(
|
|
59
|
+
name="etf_list",
|
|
60
|
+
path="etf/list",
|
|
61
|
+
version=APIVersion.V3,
|
|
62
|
+
url_type=URLType.API,
|
|
63
|
+
method=HTTPMethod.GET,
|
|
64
|
+
description=(
|
|
65
|
+
"Get a complete list of all available ETFs (Exchange Traded Funds) with their "
|
|
66
|
+
"basic information. Provides a comprehensive view of tradable ETF products."
|
|
67
|
+
),
|
|
68
|
+
mandatory_params=[],
|
|
69
|
+
optional_params=[],
|
|
70
|
+
response_model=CompanySymbol,
|
|
71
|
+
arg_model=ETFListArgs,
|
|
72
|
+
example_queries=[
|
|
73
|
+
"List all available ETFs",
|
|
74
|
+
"Show me tradable ETF symbols",
|
|
75
|
+
"What ETFs can I invest in?",
|
|
76
|
+
"Get a complete list of ETFs",
|
|
77
|
+
"Show all exchange traded funds",
|
|
78
|
+
],
|
|
79
|
+
)
|
|
80
|
+
AVAILABLE_INDEXES: Endpoint = Endpoint(
|
|
81
|
+
name="available_indexes",
|
|
82
|
+
path="symbol/available-indexes",
|
|
83
|
+
version=APIVersion.V3,
|
|
84
|
+
url_type=URLType.API,
|
|
85
|
+
method=HTTPMethod.GET,
|
|
86
|
+
description=(
|
|
87
|
+
"Get a comprehensive list of all available market indexes including major "
|
|
88
|
+
"stock market indices, sector indexes, and other benchmark indicators. "
|
|
89
|
+
"Provides information about tradable and trackable market indexes along "
|
|
90
|
+
"with their basic details such as name, currency, and exchange."
|
|
91
|
+
),
|
|
92
|
+
mandatory_params=[],
|
|
93
|
+
optional_params=[],
|
|
94
|
+
response_model=AvailableIndex,
|
|
95
|
+
arg_model=AvailableIndexesArgs,
|
|
96
|
+
example_queries=[
|
|
97
|
+
"List all available market indexes",
|
|
98
|
+
"Show me tradable market indices",
|
|
99
|
+
"What stock market indexes are available?",
|
|
100
|
+
"Get information about market indices",
|
|
101
|
+
"Show all benchmark indexes",
|
|
102
|
+
],
|
|
103
|
+
)
|
|
104
|
+
SEARCH: Endpoint = Endpoint(
|
|
105
|
+
name="search",
|
|
106
|
+
path="search",
|
|
107
|
+
version=APIVersion.V3,
|
|
108
|
+
url_type=URLType.API,
|
|
109
|
+
method=HTTPMethod.GET,
|
|
110
|
+
description=(
|
|
111
|
+
"Search for companies by name, ticker, or other identifiers. Returns matching "
|
|
112
|
+
"companies with their basic information including symbol, name, and exchange. "
|
|
113
|
+
"Useful for finding companies based on keywords or partial matches."
|
|
114
|
+
),
|
|
115
|
+
mandatory_params=[
|
|
116
|
+
EndpointParam(
|
|
117
|
+
name="query",
|
|
118
|
+
location=ParamLocation.QUERY,
|
|
119
|
+
param_type=ParamType.STRING,
|
|
120
|
+
required=True,
|
|
121
|
+
description="Search query string",
|
|
122
|
+
)
|
|
123
|
+
],
|
|
124
|
+
optional_params=[
|
|
125
|
+
EndpointParam(
|
|
126
|
+
name="limit",
|
|
127
|
+
location=ParamLocation.QUERY,
|
|
128
|
+
param_type=ParamType.INTEGER,
|
|
129
|
+
required=False,
|
|
130
|
+
description="Maximum number of results",
|
|
131
|
+
default=10,
|
|
132
|
+
),
|
|
133
|
+
EndpointParam(
|
|
134
|
+
name="exchange",
|
|
135
|
+
location=ParamLocation.QUERY,
|
|
136
|
+
param_type=ParamType.STRING,
|
|
137
|
+
required=False,
|
|
138
|
+
description="Filter by exchange",
|
|
139
|
+
),
|
|
140
|
+
],
|
|
141
|
+
response_model=CompanySearchResult,
|
|
142
|
+
arg_model=SearchArgs,
|
|
143
|
+
example_queries=[
|
|
144
|
+
"Search for companies with 'tech' in their name",
|
|
145
|
+
"Find companies related to artificial intelligence",
|
|
146
|
+
"Look up companies in the healthcare sector",
|
|
147
|
+
"Search for banks listed on NYSE",
|
|
148
|
+
"Find companies matching 'renewable energy'",
|
|
149
|
+
],
|
|
150
|
+
)
|
|
151
|
+
EXCHANGE_SYMBOLS: Endpoint = Endpoint(
|
|
152
|
+
name="exchange_symbols",
|
|
153
|
+
path="symbol/{exchange}",
|
|
154
|
+
version=APIVersion.V3,
|
|
155
|
+
url_type=URLType.API,
|
|
156
|
+
method=HTTPMethod.GET,
|
|
157
|
+
description=(
|
|
158
|
+
"Get all symbols listed on a specific exchange. Returns detailed information "
|
|
159
|
+
"about all securities trading on the specified exchange including stocks, "
|
|
160
|
+
"ETFs, and other instruments."
|
|
161
|
+
),
|
|
162
|
+
mandatory_params=[
|
|
163
|
+
EndpointParam(
|
|
164
|
+
name="exchange",
|
|
165
|
+
location=ParamLocation.PATH,
|
|
166
|
+
param_type=ParamType.STRING,
|
|
167
|
+
required=True,
|
|
168
|
+
description="Exchange code (e.g., NYSE, NASDAQ)",
|
|
169
|
+
valid_values=None, # Will be validated by schema pattern
|
|
170
|
+
)
|
|
171
|
+
],
|
|
172
|
+
optional_params=[],
|
|
173
|
+
response_model=ExchangeSymbol,
|
|
174
|
+
arg_model=BaseExchangeArg, # Updated to use the base class
|
|
175
|
+
example_queries=[
|
|
176
|
+
"List all symbols on NYSE",
|
|
177
|
+
"Show me NASDAQ listed companies",
|
|
178
|
+
"What securities trade on LSE?",
|
|
179
|
+
"Get all stocks listed on TSX",
|
|
180
|
+
"Show symbols available on ASX",
|
|
181
|
+
],
|
|
182
|
+
)
|
|
183
|
+
|
|
184
|
+
CIK_SEARCH: Endpoint = Endpoint(
|
|
185
|
+
name="cik_search",
|
|
186
|
+
path="cik-search",
|
|
187
|
+
version=APIVersion.V3,
|
|
188
|
+
url_type=URLType.API,
|
|
189
|
+
method=HTTPMethod.GET,
|
|
190
|
+
description=(
|
|
191
|
+
"Search for companies by their CIK (Central Index Key) number. Useful for "
|
|
192
|
+
"finding companies using their SEC identifier and accessing regulatory filings."
|
|
193
|
+
),
|
|
194
|
+
mandatory_params=[
|
|
195
|
+
EndpointParam(
|
|
196
|
+
name="query",
|
|
197
|
+
location=ParamLocation.QUERY,
|
|
198
|
+
param_type=ParamType.STRING,
|
|
199
|
+
required=True,
|
|
200
|
+
description="Search query",
|
|
201
|
+
)
|
|
202
|
+
],
|
|
203
|
+
optional_params=[],
|
|
204
|
+
response_model=CIKResult,
|
|
205
|
+
arg_model=BaseSearchArg,
|
|
206
|
+
example_queries=[
|
|
207
|
+
"Find company with CIK number 320193",
|
|
208
|
+
"Search for company by CIK",
|
|
209
|
+
"Look up SEC CIK information",
|
|
210
|
+
"Get company details by CIK",
|
|
211
|
+
"Find ticker symbol for CIK",
|
|
212
|
+
],
|
|
213
|
+
)
|
|
214
|
+
|
|
215
|
+
CUSIP_SEARCH: Endpoint = Endpoint(
|
|
216
|
+
name="cusip_search",
|
|
217
|
+
path="cusip",
|
|
218
|
+
version=APIVersion.V3,
|
|
219
|
+
url_type=URLType.API,
|
|
220
|
+
method=HTTPMethod.GET,
|
|
221
|
+
description=(
|
|
222
|
+
"Search for companies by their CUSIP (Committee on Uniform Securities "
|
|
223
|
+
"Identification Procedures) number. Helps identify securities using their "
|
|
224
|
+
"unique identifier."
|
|
225
|
+
),
|
|
226
|
+
mandatory_params=[
|
|
227
|
+
EndpointParam(
|
|
228
|
+
name="query",
|
|
229
|
+
location=ParamLocation.QUERY,
|
|
230
|
+
param_type=ParamType.STRING,
|
|
231
|
+
required=True,
|
|
232
|
+
description="Search query",
|
|
233
|
+
)
|
|
234
|
+
],
|
|
235
|
+
optional_params=[],
|
|
236
|
+
response_model=CUSIPResult,
|
|
237
|
+
arg_model=BaseSearchArg,
|
|
238
|
+
example_queries=[
|
|
239
|
+
"Find company by CUSIP number",
|
|
240
|
+
"Search securities using CUSIP",
|
|
241
|
+
"Look up stock with CUSIP",
|
|
242
|
+
"Get company information by CUSIP",
|
|
243
|
+
"Find ticker for CUSIP",
|
|
244
|
+
],
|
|
245
|
+
)
|
|
246
|
+
|
|
247
|
+
ISIN_SEARCH: Endpoint = Endpoint(
|
|
248
|
+
name="isin_search",
|
|
249
|
+
path="search/isin",
|
|
250
|
+
version=APIVersion.V4,
|
|
251
|
+
url_type=URLType.API,
|
|
252
|
+
method=HTTPMethod.GET,
|
|
253
|
+
description=(
|
|
254
|
+
"Search for companies by their ISIN (International Securities Identification "
|
|
255
|
+
"Number). Used to find securities using their globally unique identifier."
|
|
256
|
+
),
|
|
257
|
+
mandatory_params=[
|
|
258
|
+
EndpointParam(
|
|
259
|
+
name="query",
|
|
260
|
+
location=ParamLocation.QUERY,
|
|
261
|
+
param_type=ParamType.STRING,
|
|
262
|
+
required=True,
|
|
263
|
+
description="Search query",
|
|
264
|
+
)
|
|
265
|
+
],
|
|
266
|
+
optional_params=[],
|
|
267
|
+
response_model=ISINResult,
|
|
268
|
+
arg_model=BaseSearchArg,
|
|
269
|
+
example_queries=[
|
|
270
|
+
"Find company by ISIN",
|
|
271
|
+
"Search using ISIN number",
|
|
272
|
+
"Look up stock with ISIN",
|
|
273
|
+
"Get security details by ISIN",
|
|
274
|
+
"Find ticker for ISIN",
|
|
275
|
+
],
|
|
276
|
+
)
|
|
277
|
+
|
|
278
|
+
MARKET_HOURS: Endpoint = Endpoint(
|
|
279
|
+
name="market_hours",
|
|
280
|
+
path="is-the-market-open",
|
|
281
|
+
version=APIVersion.V3,
|
|
282
|
+
description="Get market trading hours information",
|
|
283
|
+
mandatory_params=[],
|
|
284
|
+
optional_params=[],
|
|
285
|
+
response_model=MarketHours,
|
|
286
|
+
)
|
|
287
|
+
|
|
288
|
+
GAINERS: Endpoint = Endpoint(
|
|
289
|
+
name="gainers",
|
|
290
|
+
path="stock_market/gainers",
|
|
291
|
+
version=APIVersion.V3,
|
|
292
|
+
description="Get market gainers",
|
|
293
|
+
mandatory_params=[],
|
|
294
|
+
optional_params=[],
|
|
295
|
+
response_model=MarketMover,
|
|
296
|
+
)
|
|
297
|
+
|
|
298
|
+
LOSERS: Endpoint = Endpoint(
|
|
299
|
+
name="losers",
|
|
300
|
+
path="stock_market/losers",
|
|
301
|
+
version=APIVersion.V3,
|
|
302
|
+
description="Get market losers",
|
|
303
|
+
mandatory_params=[],
|
|
304
|
+
optional_params=[],
|
|
305
|
+
response_model=MarketMover,
|
|
306
|
+
)
|
|
307
|
+
|
|
308
|
+
MOST_ACTIVE: Endpoint = Endpoint(
|
|
309
|
+
name="most_active",
|
|
310
|
+
path="stock_market/actives",
|
|
311
|
+
version=APIVersion.V3,
|
|
312
|
+
description="Get most active stocks",
|
|
313
|
+
mandatory_params=[],
|
|
314
|
+
optional_params=[],
|
|
315
|
+
response_model=MarketMover,
|
|
316
|
+
)
|
|
317
|
+
|
|
318
|
+
SECTOR_PERFORMANCE: Endpoint = Endpoint(
|
|
319
|
+
name="sector_performance",
|
|
320
|
+
path="sectors-performance",
|
|
321
|
+
version=APIVersion.V3,
|
|
322
|
+
description="Get sector performance data",
|
|
323
|
+
mandatory_params=[],
|
|
324
|
+
optional_params=[],
|
|
325
|
+
response_model=SectorPerformance,
|
|
326
|
+
)
|
|
327
|
+
|
|
328
|
+
PRE_POST_MARKET: Endpoint = Endpoint(
|
|
329
|
+
name="pre_post_market",
|
|
330
|
+
path="pre-post-market",
|
|
331
|
+
version=APIVersion.V4,
|
|
332
|
+
description="Get pre/post market data",
|
|
333
|
+
mandatory_params=[],
|
|
334
|
+
optional_params=[],
|
|
335
|
+
response_model=PrePostMarketQuote,
|
|
336
|
+
)
|
|
337
|
+
|
|
338
|
+
ALL_SHARES_FLOAT: Endpoint = Endpoint(
|
|
339
|
+
name="all_shares_float",
|
|
340
|
+
path="shares_float/all",
|
|
341
|
+
version=APIVersion.V4,
|
|
342
|
+
description=(
|
|
343
|
+
"Get share float data for all companies at once. Provides a comprehensive "
|
|
344
|
+
"view of market-wide float data, useful for screening and comparing "
|
|
345
|
+
"companies based on their float characteristics."
|
|
346
|
+
),
|
|
347
|
+
mandatory_params=[],
|
|
348
|
+
optional_params=[],
|
|
349
|
+
response_model=ShareFloat,
|
|
350
|
+
arg_model=StockListArgs, # Using StockListArgs since it's a no-parameter endpoint
|
|
351
|
+
example_queries=[
|
|
352
|
+
"Get share float data for all companies",
|
|
353
|
+
"Show market-wide float information",
|
|
354
|
+
"List float data across all stocks",
|
|
355
|
+
"Compare share floats across companies",
|
|
356
|
+
"Get complete market float data",
|
|
357
|
+
],
|
|
358
|
+
)
|
fmp_data/market/hints.py
ADDED
|
@@ -0,0 +1,22 @@
|
|
|
1
|
+
from fmp_data.lc.models import ParameterHint
|
|
2
|
+
|
|
3
|
+
COMPANY_SEARCH_HINT = ParameterHint(
|
|
4
|
+
natural_names=["search term", "query", "keyword"],
|
|
5
|
+
extraction_patterns=[
|
|
6
|
+
r"(?:search|find|look up)\s+(.+?)(?:\s+in|\s+on|\s*$)",
|
|
7
|
+
r"(?:about|related to)\s+(.+?)(?:\s+in|\s+on|\s*$)",
|
|
8
|
+
],
|
|
9
|
+
examples=["tech companies", "renewable energy", "artificial intelligence"],
|
|
10
|
+
context_clues=["search", "find", "look up", "about", "related to"],
|
|
11
|
+
)
|
|
12
|
+
|
|
13
|
+
IDENTIFIER_HINT = ParameterHint(
|
|
14
|
+
natural_names=["identifier", "ID", "number"],
|
|
15
|
+
extraction_patterns=[
|
|
16
|
+
r"\b\d{6,10}\b", # CIK numbers
|
|
17
|
+
r"\b[0-9A-Z]{9}\b", # CUSIP
|
|
18
|
+
r"\b[A-Z]{2}[A-Z0-9]{9}\d\b", # ISIN
|
|
19
|
+
],
|
|
20
|
+
examples=["320193", "037833100", "US0378331005"],
|
|
21
|
+
context_clues=["number", "identifier", "ID", "code"],
|
|
22
|
+
)
|