adanos 1.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.
- adanos/__init__.py +7 -0
- adanos/_generated/__init__.py +8 -0
- adanos/_generated/api/__init__.py +1 -0
- adanos/_generated/api/news_stocks/__init__.py +1 -0
- adanos/_generated/api/news_stocks/compare_news_stocks.py +248 -0
- adanos/_generated/api/news_stocks/get_news_stats.py +152 -0
- adanos/_generated/api/news_stocks/get_news_stock_explanation.py +232 -0
- adanos/_generated/api/news_stocks/get_news_stock_sentiment.py +249 -0
- adanos/_generated/api/news_stocks/get_news_trending_countries.py +292 -0
- adanos/_generated/api/news_stocks/get_news_trending_sectors.py +292 -0
- adanos/_generated/api/news_stocks/get_news_trending_stocks.py +325 -0
- adanos/_generated/api/news_stocks/search_news_stocks.py +196 -0
- adanos/_generated/api/polymarket_stocks/__init__.py +1 -0
- adanos/_generated/api/polymarket_stocks/compare_polymarket_stocks.py +248 -0
- adanos/_generated/api/polymarket_stocks/get_polymarket_stats.py +152 -0
- adanos/_generated/api/polymarket_stocks/get_polymarket_stock.py +249 -0
- adanos/_generated/api/polymarket_stocks/get_polymarket_trending_countries.py +260 -0
- adanos/_generated/api/polymarket_stocks/get_polymarket_trending_sectors.py +260 -0
- adanos/_generated/api/polymarket_stocks/get_polymarket_trending_stocks.py +289 -0
- adanos/_generated/api/polymarket_stocks/search_polymarket_stocks.py +223 -0
- adanos/_generated/api/reddit_crypto/__init__.py +1 -0
- adanos/_generated/api/reddit_crypto/compare_reddit_crypto_tokens.py +248 -0
- adanos/_generated/api/reddit_crypto/get_reddit_crypto_stats.py +156 -0
- adanos/_generated/api/reddit_crypto/get_reddit_crypto_token.py +249 -0
- adanos/_generated/api/reddit_crypto/get_reddit_crypto_trending.py +268 -0
- adanos/_generated/api/reddit_crypto/search_reddit_crypto.py +214 -0
- adanos/_generated/api/reddit_stocks/__init__.py +1 -0
- adanos/_generated/api/reddit_stocks/compare_stocks.py +236 -0
- adanos/_generated/api/reddit_stocks/get_stats.py +152 -0
- adanos/_generated/api/reddit_stocks/get_stock_explanation.py +276 -0
- adanos/_generated/api/reddit_stocks/get_stock_sentiment.py +265 -0
- adanos/_generated/api/reddit_stocks/get_trending_countries.py +316 -0
- adanos/_generated/api/reddit_stocks/get_trending_sectors.py +316 -0
- adanos/_generated/api/reddit_stocks/get_trending_stocks.py +371 -0
- adanos/_generated/api/reddit_stocks/search_stocks.py +200 -0
- adanos/_generated/api/status/__init__.py +1 -0
- adanos/_generated/api/status/get_health.py +163 -0
- adanos/_generated/api/status/get_news_health.py +135 -0
- adanos/_generated/api/status/get_polymarket_health.py +163 -0
- adanos/_generated/api/status/get_reddit_crypto_health.py +135 -0
- adanos/_generated/api/status/get_x_health.py +163 -0
- adanos/_generated/api/x_twitter_stocks/__init__.py +1 -0
- adanos/_generated/api/x_twitter_stocks/compare_x_stocks.py +236 -0
- adanos/_generated/api/x_twitter_stocks/get_x_stats.py +180 -0
- adanos/_generated/api/x_twitter_stocks/get_x_stock_sentiment.py +293 -0
- adanos/_generated/api/x_twitter_stocks/get_x_trending_countries.py +301 -0
- adanos/_generated/api/x_twitter_stocks/get_x_trending_sectors.py +301 -0
- adanos/_generated/api/x_twitter_stocks/get_x_trending_stocks.py +356 -0
- adanos/_generated/api/x_twitter_stocks/search_x_stocks.py +196 -0
- adanos/_generated/client.py +282 -0
- adanos/_generated/errors.py +16 -0
- adanos/_generated/models/__init__.py +185 -0
- adanos/_generated/models/compare_response.py +84 -0
- adanos/_generated/models/compare_stock_item.py +128 -0
- adanos/_generated/models/crypto_compare_response.py +84 -0
- adanos/_generated/models/crypto_compare_token_item.py +128 -0
- adanos/_generated/models/crypto_health_response.py +180 -0
- adanos/_generated/models/crypto_scheduler_status.py +142 -0
- adanos/_generated/models/crypto_search_item.py +163 -0
- adanos/_generated/models/crypto_search_response.py +92 -0
- adanos/_generated/models/crypto_stats_response.py +86 -0
- adanos/_generated/models/crypto_token_sentiment.py +528 -0
- adanos/_generated/models/crypto_token_sentiment_daily_trend_type_0_item.py +46 -0
- adanos/_generated/models/crypto_token_sentiment_top_mentions_type_0_item.py +46 -0
- adanos/_generated/models/crypto_token_sentiment_top_subreddits_type_0_item.py +46 -0
- adanos/_generated/models/crypto_token_sentiment_trend_type_0.py +10 -0
- adanos/_generated/models/crypto_trending_token.py +168 -0
- adanos/_generated/models/crypto_trending_token_trend.py +10 -0
- adanos/_generated/models/daily_trend_item.py +112 -0
- adanos/_generated/models/error_response.py +62 -0
- adanos/_generated/models/get_news_trending_stocks_type_type_0.py +10 -0
- adanos/_generated/models/get_polymarket_trending_stocks_type_type_0.py +10 -0
- adanos/_generated/models/get_trending_stocks_type_type_0.py +10 -0
- adanos/_generated/models/get_x_trending_stocks_type_type_0.py +10 -0
- adanos/_generated/models/health_response.py +180 -0
- adanos/_generated/models/historical_limit_error.py +68 -0
- adanos/_generated/models/historical_limit_error_detail.py +94 -0
- adanos/_generated/models/http_validation_error.py +80 -0
- adanos/_generated/models/news_compare_response.py +84 -0
- adanos/_generated/models/news_compare_stock_item.py +128 -0
- adanos/_generated/models/news_source_count.py +70 -0
- adanos/_generated/models/news_stock_sentiment.py +458 -0
- adanos/_generated/models/news_stock_sentiment_trend_type_0.py +10 -0
- adanos/_generated/models/news_top_mention.py +94 -0
- adanos/_generated/models/news_trending_country.py +138 -0
- adanos/_generated/models/news_trending_country_trend.py +10 -0
- adanos/_generated/models/news_trending_sector.py +138 -0
- adanos/_generated/models/news_trending_sector_trend.py +10 -0
- adanos/_generated/models/news_trending_stock.py +154 -0
- adanos/_generated/models/news_trending_stock_trend.py +10 -0
- adanos/_generated/models/polymarket_compare_response.py +84 -0
- adanos/_generated/models/polymarket_compare_stock_item.py +156 -0
- adanos/_generated/models/polymarket_daily_trend_item.py +112 -0
- adanos/_generated/models/polymarket_health_response.py +154 -0
- adanos/_generated/models/polymarket_scheduler_status.py +131 -0
- adanos/_generated/models/polymarket_search_response.py +92 -0
- adanos/_generated/models/polymarket_search_result_item.py +171 -0
- adanos/_generated/models/polymarket_stats_response.py +94 -0
- adanos/_generated/models/polymarket_stock_detail_response.py +461 -0
- adanos/_generated/models/polymarket_stock_detail_response_trend_type_0.py +10 -0
- adanos/_generated/models/polymarket_top_mention.py +204 -0
- adanos/_generated/models/polymarket_trending_country.py +178 -0
- adanos/_generated/models/polymarket_trending_country_trend.py +10 -0
- adanos/_generated/models/polymarket_trending_sector.py +178 -0
- adanos/_generated/models/polymarket_trending_sector_trend.py +10 -0
- adanos/_generated/models/polymarket_trending_stock.py +192 -0
- adanos/_generated/models/polymarket_trending_stock_trend.py +10 -0
- adanos/_generated/models/scheduler_status.py +142 -0
- adanos/_generated/models/search_response.py +92 -0
- adanos/_generated/models/search_result_item.py +203 -0
- adanos/_generated/models/stats_response.py +86 -0
- adanos/_generated/models/stock_explanation_response.py +128 -0
- adanos/_generated/models/stock_sentiment.py +523 -0
- adanos/_generated/models/stock_sentiment_daily_trend_type_0_item.py +46 -0
- adanos/_generated/models/stock_sentiment_top_mentions_type_0_item.py +46 -0
- adanos/_generated/models/stock_sentiment_top_subreddits_type_0_item.py +46 -0
- adanos/_generated/models/stock_sentiment_trend_type_0.py +10 -0
- adanos/_generated/models/trending_country.py +146 -0
- adanos/_generated/models/trending_country_trend.py +10 -0
- adanos/_generated/models/trending_sector.py +146 -0
- adanos/_generated/models/trending_sector_trend.py +10 -0
- adanos/_generated/models/trending_stock.py +170 -0
- adanos/_generated/models/trending_stock_trend.py +10 -0
- adanos/_generated/models/validation_error.py +91 -0
- adanos/_generated/models/x_daily_trend_item.py +132 -0
- adanos/_generated/models/x_health_response.py +154 -0
- adanos/_generated/models/x_scheduler_status.py +131 -0
- adanos/_generated/models/x_stats_response.py +132 -0
- adanos/_generated/models/x_stock_detail_response.py +447 -0
- adanos/_generated/models/x_stock_detail_response_trend_type_0.py +10 -0
- adanos/_generated/models/x_top_tweet.py +180 -0
- adanos/_generated/models/x_trending_country.py +195 -0
- adanos/_generated/models/x_trending_country_trend.py +10 -0
- adanos/_generated/models/x_trending_sector.py +195 -0
- adanos/_generated/models/x_trending_sector_trend.py +10 -0
- adanos/_generated/models/x_trending_stock.py +234 -0
- adanos/_generated/types.py +54 -0
- adanos/_wrapper.py +867 -0
- adanos/py.typed +0 -0
- adanos-1.0.0.dist-info/METADATA +376 -0
- adanos-1.0.0.dist-info/RECORD +143 -0
- adanos-1.0.0.dist-info/WHEEL +4 -0
- adanos-1.0.0.dist-info/licenses/LICENSE +21 -0
adanos/__init__.py
ADDED
|
@@ -0,0 +1 @@
|
|
|
1
|
+
"""Contains methods for accessing the API"""
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
"""Contains endpoint functions for accessing the API"""
|
|
@@ -0,0 +1,248 @@
|
|
|
1
|
+
from http import HTTPStatus
|
|
2
|
+
from typing import Any, cast
|
|
3
|
+
|
|
4
|
+
import httpx
|
|
5
|
+
|
|
6
|
+
from ... import errors
|
|
7
|
+
from ...client import AuthenticatedClient, Client
|
|
8
|
+
from ...models.error_response import ErrorResponse
|
|
9
|
+
from ...models.historical_limit_error import HistoricalLimitError
|
|
10
|
+
from ...models.http_validation_error import HTTPValidationError
|
|
11
|
+
from ...models.news_compare_response import NewsCompareResponse
|
|
12
|
+
from ...types import UNSET, Response, Unset
|
|
13
|
+
|
|
14
|
+
|
|
15
|
+
def _get_kwargs(
|
|
16
|
+
*,
|
|
17
|
+
tickers: str,
|
|
18
|
+
days: int | Unset = 7,
|
|
19
|
+
) -> dict[str, Any]:
|
|
20
|
+
params: dict[str, Any] = {}
|
|
21
|
+
|
|
22
|
+
params["tickers"] = tickers
|
|
23
|
+
|
|
24
|
+
params["days"] = days
|
|
25
|
+
|
|
26
|
+
params = {k: v for k, v in params.items() if v is not UNSET and v is not None}
|
|
27
|
+
|
|
28
|
+
_kwargs: dict[str, Any] = {
|
|
29
|
+
"method": "get",
|
|
30
|
+
"url": "/news/stocks/v1/compare",
|
|
31
|
+
"params": params,
|
|
32
|
+
}
|
|
33
|
+
|
|
34
|
+
return _kwargs
|
|
35
|
+
|
|
36
|
+
|
|
37
|
+
def _parse_response(
|
|
38
|
+
*, client: AuthenticatedClient | Client, response: httpx.Response
|
|
39
|
+
) -> (
|
|
40
|
+
Any
|
|
41
|
+
| ErrorResponse
|
|
42
|
+
| HTTPValidationError
|
|
43
|
+
| HistoricalLimitError
|
|
44
|
+
| NewsCompareResponse
|
|
45
|
+
| None
|
|
46
|
+
):
|
|
47
|
+
if response.status_code == 200:
|
|
48
|
+
response_200 = NewsCompareResponse.from_dict(response.json())
|
|
49
|
+
|
|
50
|
+
return response_200
|
|
51
|
+
|
|
52
|
+
if response.status_code == 400:
|
|
53
|
+
response_400 = cast(Any, None)
|
|
54
|
+
return response_400
|
|
55
|
+
|
|
56
|
+
if response.status_code == 401:
|
|
57
|
+
response_401 = ErrorResponse.from_dict(response.json())
|
|
58
|
+
|
|
59
|
+
return response_401
|
|
60
|
+
|
|
61
|
+
if response.status_code == 403:
|
|
62
|
+
response_403 = HistoricalLimitError.from_dict(response.json())
|
|
63
|
+
|
|
64
|
+
return response_403
|
|
65
|
+
|
|
66
|
+
if response.status_code == 422:
|
|
67
|
+
response_422 = HTTPValidationError.from_dict(response.json())
|
|
68
|
+
|
|
69
|
+
return response_422
|
|
70
|
+
|
|
71
|
+
if response.status_code == 429:
|
|
72
|
+
response_429 = ErrorResponse.from_dict(response.json())
|
|
73
|
+
|
|
74
|
+
return response_429
|
|
75
|
+
|
|
76
|
+
if client.raise_on_unexpected_status:
|
|
77
|
+
raise errors.UnexpectedStatus(response.status_code, response.content)
|
|
78
|
+
else:
|
|
79
|
+
return None
|
|
80
|
+
|
|
81
|
+
|
|
82
|
+
def _build_response(
|
|
83
|
+
*, client: AuthenticatedClient | Client, response: httpx.Response
|
|
84
|
+
) -> Response[
|
|
85
|
+
Any
|
|
86
|
+
| ErrorResponse
|
|
87
|
+
| HTTPValidationError
|
|
88
|
+
| HistoricalLimitError
|
|
89
|
+
| NewsCompareResponse
|
|
90
|
+
]:
|
|
91
|
+
return Response(
|
|
92
|
+
status_code=HTTPStatus(response.status_code),
|
|
93
|
+
content=response.content,
|
|
94
|
+
headers=response.headers,
|
|
95
|
+
parsed=_parse_response(client=client, response=response),
|
|
96
|
+
)
|
|
97
|
+
|
|
98
|
+
|
|
99
|
+
def sync_detailed(
|
|
100
|
+
*,
|
|
101
|
+
client: AuthenticatedClient,
|
|
102
|
+
tickers: str,
|
|
103
|
+
days: int | Unset = 7,
|
|
104
|
+
) -> Response[
|
|
105
|
+
Any
|
|
106
|
+
| ErrorResponse
|
|
107
|
+
| HTTPValidationError
|
|
108
|
+
| HistoricalLimitError
|
|
109
|
+
| NewsCompareResponse
|
|
110
|
+
]:
|
|
111
|
+
"""Compare multiple stocks
|
|
112
|
+
|
|
113
|
+
Compare multiple stock tickers side by side using the news sentiment dataset and buzz score model.
|
|
114
|
+
|
|
115
|
+
Args:
|
|
116
|
+
tickers (str): Comma-separated list of ticker symbols (e.g., TSLA,NVDA,AMD)
|
|
117
|
+
days (int | Unset): Time period in days to analyze (1-30 free, 1-90 paid) Default: 7.
|
|
118
|
+
|
|
119
|
+
Raises:
|
|
120
|
+
errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True.
|
|
121
|
+
httpx.TimeoutException: If the request takes longer than Client.timeout.
|
|
122
|
+
|
|
123
|
+
Returns:
|
|
124
|
+
Response[Any | ErrorResponse | HTTPValidationError | HistoricalLimitError | NewsCompareResponse]
|
|
125
|
+
"""
|
|
126
|
+
|
|
127
|
+
kwargs = _get_kwargs(
|
|
128
|
+
tickers=tickers,
|
|
129
|
+
days=days,
|
|
130
|
+
)
|
|
131
|
+
|
|
132
|
+
response = client.get_httpx_client().request(
|
|
133
|
+
**kwargs,
|
|
134
|
+
)
|
|
135
|
+
|
|
136
|
+
return _build_response(client=client, response=response)
|
|
137
|
+
|
|
138
|
+
|
|
139
|
+
def sync(
|
|
140
|
+
*,
|
|
141
|
+
client: AuthenticatedClient,
|
|
142
|
+
tickers: str,
|
|
143
|
+
days: int | Unset = 7,
|
|
144
|
+
) -> (
|
|
145
|
+
Any
|
|
146
|
+
| ErrorResponse
|
|
147
|
+
| HTTPValidationError
|
|
148
|
+
| HistoricalLimitError
|
|
149
|
+
| NewsCompareResponse
|
|
150
|
+
| None
|
|
151
|
+
):
|
|
152
|
+
"""Compare multiple stocks
|
|
153
|
+
|
|
154
|
+
Compare multiple stock tickers side by side using the news sentiment dataset and buzz score model.
|
|
155
|
+
|
|
156
|
+
Args:
|
|
157
|
+
tickers (str): Comma-separated list of ticker symbols (e.g., TSLA,NVDA,AMD)
|
|
158
|
+
days (int | Unset): Time period in days to analyze (1-30 free, 1-90 paid) Default: 7.
|
|
159
|
+
|
|
160
|
+
Raises:
|
|
161
|
+
errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True.
|
|
162
|
+
httpx.TimeoutException: If the request takes longer than Client.timeout.
|
|
163
|
+
|
|
164
|
+
Returns:
|
|
165
|
+
Any | ErrorResponse | HTTPValidationError | HistoricalLimitError | NewsCompareResponse
|
|
166
|
+
"""
|
|
167
|
+
|
|
168
|
+
return sync_detailed(
|
|
169
|
+
client=client,
|
|
170
|
+
tickers=tickers,
|
|
171
|
+
days=days,
|
|
172
|
+
).parsed
|
|
173
|
+
|
|
174
|
+
|
|
175
|
+
async def asyncio_detailed(
|
|
176
|
+
*,
|
|
177
|
+
client: AuthenticatedClient,
|
|
178
|
+
tickers: str,
|
|
179
|
+
days: int | Unset = 7,
|
|
180
|
+
) -> Response[
|
|
181
|
+
Any
|
|
182
|
+
| ErrorResponse
|
|
183
|
+
| HTTPValidationError
|
|
184
|
+
| HistoricalLimitError
|
|
185
|
+
| NewsCompareResponse
|
|
186
|
+
]:
|
|
187
|
+
"""Compare multiple stocks
|
|
188
|
+
|
|
189
|
+
Compare multiple stock tickers side by side using the news sentiment dataset and buzz score model.
|
|
190
|
+
|
|
191
|
+
Args:
|
|
192
|
+
tickers (str): Comma-separated list of ticker symbols (e.g., TSLA,NVDA,AMD)
|
|
193
|
+
days (int | Unset): Time period in days to analyze (1-30 free, 1-90 paid) Default: 7.
|
|
194
|
+
|
|
195
|
+
Raises:
|
|
196
|
+
errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True.
|
|
197
|
+
httpx.TimeoutException: If the request takes longer than Client.timeout.
|
|
198
|
+
|
|
199
|
+
Returns:
|
|
200
|
+
Response[Any | ErrorResponse | HTTPValidationError | HistoricalLimitError | NewsCompareResponse]
|
|
201
|
+
"""
|
|
202
|
+
|
|
203
|
+
kwargs = _get_kwargs(
|
|
204
|
+
tickers=tickers,
|
|
205
|
+
days=days,
|
|
206
|
+
)
|
|
207
|
+
|
|
208
|
+
response = await client.get_async_httpx_client().request(**kwargs)
|
|
209
|
+
|
|
210
|
+
return _build_response(client=client, response=response)
|
|
211
|
+
|
|
212
|
+
|
|
213
|
+
async def asyncio(
|
|
214
|
+
*,
|
|
215
|
+
client: AuthenticatedClient,
|
|
216
|
+
tickers: str,
|
|
217
|
+
days: int | Unset = 7,
|
|
218
|
+
) -> (
|
|
219
|
+
Any
|
|
220
|
+
| ErrorResponse
|
|
221
|
+
| HTTPValidationError
|
|
222
|
+
| HistoricalLimitError
|
|
223
|
+
| NewsCompareResponse
|
|
224
|
+
| None
|
|
225
|
+
):
|
|
226
|
+
"""Compare multiple stocks
|
|
227
|
+
|
|
228
|
+
Compare multiple stock tickers side by side using the news sentiment dataset and buzz score model.
|
|
229
|
+
|
|
230
|
+
Args:
|
|
231
|
+
tickers (str): Comma-separated list of ticker symbols (e.g., TSLA,NVDA,AMD)
|
|
232
|
+
days (int | Unset): Time period in days to analyze (1-30 free, 1-90 paid) Default: 7.
|
|
233
|
+
|
|
234
|
+
Raises:
|
|
235
|
+
errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True.
|
|
236
|
+
httpx.TimeoutException: If the request takes longer than Client.timeout.
|
|
237
|
+
|
|
238
|
+
Returns:
|
|
239
|
+
Any | ErrorResponse | HTTPValidationError | HistoricalLimitError | NewsCompareResponse
|
|
240
|
+
"""
|
|
241
|
+
|
|
242
|
+
return (
|
|
243
|
+
await asyncio_detailed(
|
|
244
|
+
client=client,
|
|
245
|
+
tickers=tickers,
|
|
246
|
+
days=days,
|
|
247
|
+
)
|
|
248
|
+
).parsed
|
|
@@ -0,0 +1,152 @@
|
|
|
1
|
+
from http import HTTPStatus
|
|
2
|
+
from typing import Any
|
|
3
|
+
|
|
4
|
+
import httpx
|
|
5
|
+
|
|
6
|
+
from ... import errors
|
|
7
|
+
from ...client import AuthenticatedClient, Client
|
|
8
|
+
from ...models.error_response import ErrorResponse
|
|
9
|
+
from ...models.historical_limit_error import HistoricalLimitError
|
|
10
|
+
from ...models.stats_response import StatsResponse
|
|
11
|
+
from ...types import Response
|
|
12
|
+
|
|
13
|
+
|
|
14
|
+
def _get_kwargs() -> dict[str, Any]:
|
|
15
|
+
_kwargs: dict[str, Any] = {
|
|
16
|
+
"method": "get",
|
|
17
|
+
"url": "/news/stocks/v1/stats",
|
|
18
|
+
}
|
|
19
|
+
|
|
20
|
+
return _kwargs
|
|
21
|
+
|
|
22
|
+
|
|
23
|
+
def _parse_response(
|
|
24
|
+
*, client: AuthenticatedClient | Client, response: httpx.Response
|
|
25
|
+
) -> ErrorResponse | HistoricalLimitError | StatsResponse | None:
|
|
26
|
+
if response.status_code == 200:
|
|
27
|
+
response_200 = StatsResponse.from_dict(response.json())
|
|
28
|
+
|
|
29
|
+
return response_200
|
|
30
|
+
|
|
31
|
+
if response.status_code == 401:
|
|
32
|
+
response_401 = ErrorResponse.from_dict(response.json())
|
|
33
|
+
|
|
34
|
+
return response_401
|
|
35
|
+
|
|
36
|
+
if response.status_code == 403:
|
|
37
|
+
response_403 = HistoricalLimitError.from_dict(response.json())
|
|
38
|
+
|
|
39
|
+
return response_403
|
|
40
|
+
|
|
41
|
+
if response.status_code == 429:
|
|
42
|
+
response_429 = ErrorResponse.from_dict(response.json())
|
|
43
|
+
|
|
44
|
+
return response_429
|
|
45
|
+
|
|
46
|
+
if client.raise_on_unexpected_status:
|
|
47
|
+
raise errors.UnexpectedStatus(response.status_code, response.content)
|
|
48
|
+
else:
|
|
49
|
+
return None
|
|
50
|
+
|
|
51
|
+
|
|
52
|
+
def _build_response(
|
|
53
|
+
*, client: AuthenticatedClient | Client, response: httpx.Response
|
|
54
|
+
) -> Response[ErrorResponse | HistoricalLimitError | StatsResponse]:
|
|
55
|
+
return Response(
|
|
56
|
+
status_code=HTTPStatus(response.status_code),
|
|
57
|
+
content=response.content,
|
|
58
|
+
headers=response.headers,
|
|
59
|
+
parsed=_parse_response(client=client, response=response),
|
|
60
|
+
)
|
|
61
|
+
|
|
62
|
+
|
|
63
|
+
def sync_detailed(
|
|
64
|
+
*,
|
|
65
|
+
client: AuthenticatedClient,
|
|
66
|
+
) -> Response[ErrorResponse | HistoricalLimitError | StatsResponse]:
|
|
67
|
+
"""Get database statistics
|
|
68
|
+
|
|
69
|
+
Return aggregate statistics for the news stocks dataset.
|
|
70
|
+
|
|
71
|
+
Raises:
|
|
72
|
+
errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True.
|
|
73
|
+
httpx.TimeoutException: If the request takes longer than Client.timeout.
|
|
74
|
+
|
|
75
|
+
Returns:
|
|
76
|
+
Response[ErrorResponse | HistoricalLimitError | StatsResponse]
|
|
77
|
+
"""
|
|
78
|
+
|
|
79
|
+
kwargs = _get_kwargs()
|
|
80
|
+
|
|
81
|
+
response = client.get_httpx_client().request(
|
|
82
|
+
**kwargs,
|
|
83
|
+
)
|
|
84
|
+
|
|
85
|
+
return _build_response(client=client, response=response)
|
|
86
|
+
|
|
87
|
+
|
|
88
|
+
def sync(
|
|
89
|
+
*,
|
|
90
|
+
client: AuthenticatedClient,
|
|
91
|
+
) -> ErrorResponse | HistoricalLimitError | StatsResponse | None:
|
|
92
|
+
"""Get database statistics
|
|
93
|
+
|
|
94
|
+
Return aggregate statistics for the news stocks dataset.
|
|
95
|
+
|
|
96
|
+
Raises:
|
|
97
|
+
errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True.
|
|
98
|
+
httpx.TimeoutException: If the request takes longer than Client.timeout.
|
|
99
|
+
|
|
100
|
+
Returns:
|
|
101
|
+
ErrorResponse | HistoricalLimitError | StatsResponse
|
|
102
|
+
"""
|
|
103
|
+
|
|
104
|
+
return sync_detailed(
|
|
105
|
+
client=client,
|
|
106
|
+
).parsed
|
|
107
|
+
|
|
108
|
+
|
|
109
|
+
async def asyncio_detailed(
|
|
110
|
+
*,
|
|
111
|
+
client: AuthenticatedClient,
|
|
112
|
+
) -> Response[ErrorResponse | HistoricalLimitError | StatsResponse]:
|
|
113
|
+
"""Get database statistics
|
|
114
|
+
|
|
115
|
+
Return aggregate statistics for the news stocks dataset.
|
|
116
|
+
|
|
117
|
+
Raises:
|
|
118
|
+
errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True.
|
|
119
|
+
httpx.TimeoutException: If the request takes longer than Client.timeout.
|
|
120
|
+
|
|
121
|
+
Returns:
|
|
122
|
+
Response[ErrorResponse | HistoricalLimitError | StatsResponse]
|
|
123
|
+
"""
|
|
124
|
+
|
|
125
|
+
kwargs = _get_kwargs()
|
|
126
|
+
|
|
127
|
+
response = await client.get_async_httpx_client().request(**kwargs)
|
|
128
|
+
|
|
129
|
+
return _build_response(client=client, response=response)
|
|
130
|
+
|
|
131
|
+
|
|
132
|
+
async def asyncio(
|
|
133
|
+
*,
|
|
134
|
+
client: AuthenticatedClient,
|
|
135
|
+
) -> ErrorResponse | HistoricalLimitError | StatsResponse | None:
|
|
136
|
+
"""Get database statistics
|
|
137
|
+
|
|
138
|
+
Return aggregate statistics for the news stocks dataset.
|
|
139
|
+
|
|
140
|
+
Raises:
|
|
141
|
+
errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True.
|
|
142
|
+
httpx.TimeoutException: If the request takes longer than Client.timeout.
|
|
143
|
+
|
|
144
|
+
Returns:
|
|
145
|
+
ErrorResponse | HistoricalLimitError | StatsResponse
|
|
146
|
+
"""
|
|
147
|
+
|
|
148
|
+
return (
|
|
149
|
+
await asyncio_detailed(
|
|
150
|
+
client=client,
|
|
151
|
+
)
|
|
152
|
+
).parsed
|
|
@@ -0,0 +1,232 @@
|
|
|
1
|
+
from http import HTTPStatus
|
|
2
|
+
from typing import Any, cast
|
|
3
|
+
from urllib.parse import quote
|
|
4
|
+
|
|
5
|
+
import httpx
|
|
6
|
+
|
|
7
|
+
from ... import errors
|
|
8
|
+
from ...client import AuthenticatedClient, Client
|
|
9
|
+
from ...models.error_response import ErrorResponse
|
|
10
|
+
from ...models.historical_limit_error import HistoricalLimitError
|
|
11
|
+
from ...models.http_validation_error import HTTPValidationError
|
|
12
|
+
from ...models.stock_explanation_response import StockExplanationResponse
|
|
13
|
+
from ...types import Response
|
|
14
|
+
|
|
15
|
+
|
|
16
|
+
def _get_kwargs(
|
|
17
|
+
ticker: str,
|
|
18
|
+
) -> dict[str, Any]:
|
|
19
|
+
_kwargs: dict[str, Any] = {
|
|
20
|
+
"method": "get",
|
|
21
|
+
"url": "/news/stocks/v1/stock/{ticker}/explain".format(
|
|
22
|
+
ticker=quote(str(ticker), safe=""),
|
|
23
|
+
),
|
|
24
|
+
}
|
|
25
|
+
|
|
26
|
+
return _kwargs
|
|
27
|
+
|
|
28
|
+
|
|
29
|
+
def _parse_response(
|
|
30
|
+
*, client: AuthenticatedClient | Client, response: httpx.Response
|
|
31
|
+
) -> (
|
|
32
|
+
Any
|
|
33
|
+
| ErrorResponse
|
|
34
|
+
| HTTPValidationError
|
|
35
|
+
| HistoricalLimitError
|
|
36
|
+
| StockExplanationResponse
|
|
37
|
+
| None
|
|
38
|
+
):
|
|
39
|
+
if response.status_code == 200:
|
|
40
|
+
response_200 = StockExplanationResponse.from_dict(response.json())
|
|
41
|
+
|
|
42
|
+
return response_200
|
|
43
|
+
|
|
44
|
+
if response.status_code == 401:
|
|
45
|
+
response_401 = ErrorResponse.from_dict(response.json())
|
|
46
|
+
|
|
47
|
+
return response_401
|
|
48
|
+
|
|
49
|
+
if response.status_code == 403:
|
|
50
|
+
response_403 = HistoricalLimitError.from_dict(response.json())
|
|
51
|
+
|
|
52
|
+
return response_403
|
|
53
|
+
|
|
54
|
+
if response.status_code == 404:
|
|
55
|
+
response_404 = cast(Any, None)
|
|
56
|
+
return response_404
|
|
57
|
+
|
|
58
|
+
if response.status_code == 422:
|
|
59
|
+
response_422 = HTTPValidationError.from_dict(response.json())
|
|
60
|
+
|
|
61
|
+
return response_422
|
|
62
|
+
|
|
63
|
+
if response.status_code == 429:
|
|
64
|
+
response_429 = ErrorResponse.from_dict(response.json())
|
|
65
|
+
|
|
66
|
+
return response_429
|
|
67
|
+
|
|
68
|
+
if response.status_code == 503:
|
|
69
|
+
response_503 = cast(Any, None)
|
|
70
|
+
return response_503
|
|
71
|
+
|
|
72
|
+
if client.raise_on_unexpected_status:
|
|
73
|
+
raise errors.UnexpectedStatus(response.status_code, response.content)
|
|
74
|
+
else:
|
|
75
|
+
return None
|
|
76
|
+
|
|
77
|
+
|
|
78
|
+
def _build_response(
|
|
79
|
+
*, client: AuthenticatedClient | Client, response: httpx.Response
|
|
80
|
+
) -> Response[
|
|
81
|
+
Any
|
|
82
|
+
| ErrorResponse
|
|
83
|
+
| HTTPValidationError
|
|
84
|
+
| HistoricalLimitError
|
|
85
|
+
| StockExplanationResponse
|
|
86
|
+
]:
|
|
87
|
+
return Response(
|
|
88
|
+
status_code=HTTPStatus(response.status_code),
|
|
89
|
+
content=response.content,
|
|
90
|
+
headers=response.headers,
|
|
91
|
+
parsed=_parse_response(client=client, response=response),
|
|
92
|
+
)
|
|
93
|
+
|
|
94
|
+
|
|
95
|
+
def sync_detailed(
|
|
96
|
+
ticker: str,
|
|
97
|
+
*,
|
|
98
|
+
client: AuthenticatedClient,
|
|
99
|
+
) -> Response[
|
|
100
|
+
Any
|
|
101
|
+
| ErrorResponse
|
|
102
|
+
| HTTPValidationError
|
|
103
|
+
| HistoricalLimitError
|
|
104
|
+
| StockExplanationResponse
|
|
105
|
+
]:
|
|
106
|
+
"""Get AI explanation for trending stock from news
|
|
107
|
+
|
|
108
|
+
Generate or return a cached explanation for why a stock is trending in the news dataset.
|
|
109
|
+
|
|
110
|
+
Args:
|
|
111
|
+
ticker (str): Stock ticker symbol (e.g., TSLA, aapl, $GME)
|
|
112
|
+
|
|
113
|
+
Raises:
|
|
114
|
+
errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True.
|
|
115
|
+
httpx.TimeoutException: If the request takes longer than Client.timeout.
|
|
116
|
+
|
|
117
|
+
Returns:
|
|
118
|
+
Response[Any | ErrorResponse | HTTPValidationError | HistoricalLimitError | StockExplanationResponse]
|
|
119
|
+
"""
|
|
120
|
+
|
|
121
|
+
kwargs = _get_kwargs(
|
|
122
|
+
ticker=ticker,
|
|
123
|
+
)
|
|
124
|
+
|
|
125
|
+
response = client.get_httpx_client().request(
|
|
126
|
+
**kwargs,
|
|
127
|
+
)
|
|
128
|
+
|
|
129
|
+
return _build_response(client=client, response=response)
|
|
130
|
+
|
|
131
|
+
|
|
132
|
+
def sync(
|
|
133
|
+
ticker: str,
|
|
134
|
+
*,
|
|
135
|
+
client: AuthenticatedClient,
|
|
136
|
+
) -> (
|
|
137
|
+
Any
|
|
138
|
+
| ErrorResponse
|
|
139
|
+
| HTTPValidationError
|
|
140
|
+
| HistoricalLimitError
|
|
141
|
+
| StockExplanationResponse
|
|
142
|
+
| None
|
|
143
|
+
):
|
|
144
|
+
"""Get AI explanation for trending stock from news
|
|
145
|
+
|
|
146
|
+
Generate or return a cached explanation for why a stock is trending in the news dataset.
|
|
147
|
+
|
|
148
|
+
Args:
|
|
149
|
+
ticker (str): Stock ticker symbol (e.g., TSLA, aapl, $GME)
|
|
150
|
+
|
|
151
|
+
Raises:
|
|
152
|
+
errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True.
|
|
153
|
+
httpx.TimeoutException: If the request takes longer than Client.timeout.
|
|
154
|
+
|
|
155
|
+
Returns:
|
|
156
|
+
Any | ErrorResponse | HTTPValidationError | HistoricalLimitError | StockExplanationResponse
|
|
157
|
+
"""
|
|
158
|
+
|
|
159
|
+
return sync_detailed(
|
|
160
|
+
ticker=ticker,
|
|
161
|
+
client=client,
|
|
162
|
+
).parsed
|
|
163
|
+
|
|
164
|
+
|
|
165
|
+
async def asyncio_detailed(
|
|
166
|
+
ticker: str,
|
|
167
|
+
*,
|
|
168
|
+
client: AuthenticatedClient,
|
|
169
|
+
) -> Response[
|
|
170
|
+
Any
|
|
171
|
+
| ErrorResponse
|
|
172
|
+
| HTTPValidationError
|
|
173
|
+
| HistoricalLimitError
|
|
174
|
+
| StockExplanationResponse
|
|
175
|
+
]:
|
|
176
|
+
"""Get AI explanation for trending stock from news
|
|
177
|
+
|
|
178
|
+
Generate or return a cached explanation for why a stock is trending in the news dataset.
|
|
179
|
+
|
|
180
|
+
Args:
|
|
181
|
+
ticker (str): Stock ticker symbol (e.g., TSLA, aapl, $GME)
|
|
182
|
+
|
|
183
|
+
Raises:
|
|
184
|
+
errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True.
|
|
185
|
+
httpx.TimeoutException: If the request takes longer than Client.timeout.
|
|
186
|
+
|
|
187
|
+
Returns:
|
|
188
|
+
Response[Any | ErrorResponse | HTTPValidationError | HistoricalLimitError | StockExplanationResponse]
|
|
189
|
+
"""
|
|
190
|
+
|
|
191
|
+
kwargs = _get_kwargs(
|
|
192
|
+
ticker=ticker,
|
|
193
|
+
)
|
|
194
|
+
|
|
195
|
+
response = await client.get_async_httpx_client().request(**kwargs)
|
|
196
|
+
|
|
197
|
+
return _build_response(client=client, response=response)
|
|
198
|
+
|
|
199
|
+
|
|
200
|
+
async def asyncio(
|
|
201
|
+
ticker: str,
|
|
202
|
+
*,
|
|
203
|
+
client: AuthenticatedClient,
|
|
204
|
+
) -> (
|
|
205
|
+
Any
|
|
206
|
+
| ErrorResponse
|
|
207
|
+
| HTTPValidationError
|
|
208
|
+
| HistoricalLimitError
|
|
209
|
+
| StockExplanationResponse
|
|
210
|
+
| None
|
|
211
|
+
):
|
|
212
|
+
"""Get AI explanation for trending stock from news
|
|
213
|
+
|
|
214
|
+
Generate or return a cached explanation for why a stock is trending in the news dataset.
|
|
215
|
+
|
|
216
|
+
Args:
|
|
217
|
+
ticker (str): Stock ticker symbol (e.g., TSLA, aapl, $GME)
|
|
218
|
+
|
|
219
|
+
Raises:
|
|
220
|
+
errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True.
|
|
221
|
+
httpx.TimeoutException: If the request takes longer than Client.timeout.
|
|
222
|
+
|
|
223
|
+
Returns:
|
|
224
|
+
Any | ErrorResponse | HTTPValidationError | HistoricalLimitError | StockExplanationResponse
|
|
225
|
+
"""
|
|
226
|
+
|
|
227
|
+
return (
|
|
228
|
+
await asyncio_detailed(
|
|
229
|
+
ticker=ticker,
|
|
230
|
+
client=client,
|
|
231
|
+
)
|
|
232
|
+
).parsed
|