marketstack-python-client 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.
Files changed (81) hide show
  1. marketstack/__init__.py +1 -0
  2. marketstack/client/__init__.py +0 -0
  3. marketstack/client/http.py +36 -0
  4. marketstack/client/marketstack.py +148 -0
  5. marketstack/models/__init__.py +0 -0
  6. marketstack/models/bond.py +47 -0
  7. marketstack/models/cik_code.py +26 -0
  8. marketstack/models/commodity.py +83 -0
  9. marketstack/models/company.py +278 -0
  10. marketstack/models/concept.py +65 -0
  11. marketstack/models/currency.py +23 -0
  12. marketstack/models/dividend.py +27 -0
  13. marketstack/models/eod.py +48 -0
  14. marketstack/models/etf.py +129 -0
  15. marketstack/models/exchange.py +117 -0
  16. marketstack/models/index.py +47 -0
  17. marketstack/models/intraday.py +43 -0
  18. marketstack/models/pagination.py +42 -0
  19. marketstack/models/split.py +24 -0
  20. marketstack/models/stockprice.py +31 -0
  21. marketstack/models/ticker.py +159 -0
  22. marketstack/models/ticker_info.py +197 -0
  23. marketstack/models/timezone.py +21 -0
  24. marketstack/namespaces/__init__.py +0 -0
  25. marketstack/namespaces/bond/__init__.py +1 -0
  26. marketstack/namespaces/bond/bond.py +12 -0
  27. marketstack/namespaces/bondlist/__init__.py +1 -0
  28. marketstack/namespaces/bondlist/bondlist.py +12 -0
  29. marketstack/namespaces/cikcode/__init__.py +1 -0
  30. marketstack/namespaces/cikcode/cikcode.py +12 -0
  31. marketstack/namespaces/commodities/__init__.py +1 -0
  32. marketstack/namespaces/commodities/commodities.py +12 -0
  33. marketstack/namespaces/commoditieshistory/__init__.py +1 -0
  34. marketstack/namespaces/commoditieshistory/commoditieshistory.py +12 -0
  35. marketstack/namespaces/company_facts/__init__.py +1 -0
  36. marketstack/namespaces/company_facts/company_facts.py +12 -0
  37. marketstack/namespaces/companyname/__init__.py +1 -0
  38. marketstack/namespaces/companyname/companyname.py +12 -0
  39. marketstack/namespaces/companyratings/__init__.py +1 -0
  40. marketstack/namespaces/companyratings/companyratings.py +12 -0
  41. marketstack/namespaces/concept/__init__.py +1 -0
  42. marketstack/namespaces/concept/concept.py +12 -0
  43. marketstack/namespaces/currencies/__init__.py +1 -0
  44. marketstack/namespaces/currencies/currencies.py +12 -0
  45. marketstack/namespaces/dividends/__init__.py +1 -0
  46. marketstack/namespaces/dividends/dividends.py +12 -0
  47. marketstack/namespaces/eod/__init__.py +1 -0
  48. marketstack/namespaces/eod/eod.py +20 -0
  49. marketstack/namespaces/etfholdings/__init__.py +1 -0
  50. marketstack/namespaces/etfholdings/etfholdings.py +12 -0
  51. marketstack/namespaces/etflist/__init__.py +1 -0
  52. marketstack/namespaces/etflist/etflist.py +12 -0
  53. marketstack/namespaces/exchanges/__init__.py +1 -0
  54. marketstack/namespaces/exchanges/exchanges.py +109 -0
  55. marketstack/namespaces/frames/__init__.py +1 -0
  56. marketstack/namespaces/frames/frames.py +12 -0
  57. marketstack/namespaces/indexinfo/__init__.py +1 -0
  58. marketstack/namespaces/indexinfo/indexinfo.py +12 -0
  59. marketstack/namespaces/indexlist/__init__.py +1 -0
  60. marketstack/namespaces/indexlist/indexlist.py +12 -0
  61. marketstack/namespaces/intraday/__init__.py +1 -0
  62. marketstack/namespaces/intraday/intraday.py +20 -0
  63. marketstack/namespaces/splits/__init__.py +1 -0
  64. marketstack/namespaces/splits/splits.py +12 -0
  65. marketstack/namespaces/stockprice/__init__.py +1 -0
  66. marketstack/namespaces/stockprice/stockprice.py +12 -0
  67. marketstack/namespaces/submissions/__init__.py +1 -0
  68. marketstack/namespaces/submissions/submissions.py +12 -0
  69. marketstack/namespaces/tickerinfo/__init__.py +1 -0
  70. marketstack/namespaces/tickerinfo/tickerinfo.py +12 -0
  71. marketstack/namespaces/tickers/__init__.py +1 -0
  72. marketstack/namespaces/tickers/tickers.py +150 -0
  73. marketstack/namespaces/tickerslist/__init__.py +1 -0
  74. marketstack/namespaces/tickerslist/tickerslist.py +12 -0
  75. marketstack/namespaces/timezones/__init__.py +1 -0
  76. marketstack/namespaces/timezones/timezones.py +12 -0
  77. marketstack_python_client-1.0.0.dist-info/METADATA +182 -0
  78. marketstack_python_client-1.0.0.dist-info/RECORD +81 -0
  79. marketstack_python_client-1.0.0.dist-info/WHEEL +5 -0
  80. marketstack_python_client-1.0.0.dist-info/licenses/LICENSE +21 -0
  81. marketstack_python_client-1.0.0.dist-info/top_level.txt +1 -0
@@ -0,0 +1,159 @@
1
+ from typing import Union
2
+ from types import NoneType
3
+ from pydantic import BaseModel
4
+ from .exchange import ExchangeDateTime
5
+ from .pagination import Pagniation, PaginationRequest, DateString
6
+ from .eod import EODBar
7
+
8
+
9
+ class TickerResponse(BaseModel):
10
+ name: str
11
+ """Company or instrument name."""
12
+ symbol: str
13
+ """Ticker symbol."""
14
+ cik: Union[NoneType, str] = None
15
+ """SEC Central Index Key."""
16
+ isin: Union[NoneType, str] = None
17
+ """International Securities Identification Number."""
18
+ cusip: Union[NoneType, str] = None
19
+ """U.S./Canada security identifier (CUSIP)."""
20
+ ein_employer_id: Union[NoneType, str] = None
21
+ """Employer Identification Number."""
22
+ lei: Union[NoneType, str] = None
23
+ """Legal Entity Identifier."""
24
+ series_id: Union[NoneType, str] = None
25
+ """Series ID."""
26
+ item_type: Union[NoneType, str] = None
27
+ """Type of item (e.g., equity)."""
28
+ sector: Union[NoneType, str] = None
29
+ """Sector of the company."""
30
+ industry: Union[NoneType, str] = None
31
+ """Industry of the company."""
32
+ sic_code: Union[NoneType, str] = None
33
+ """Standard Industrial Classification code."""
34
+ sic_name: Union[NoneType, str] = None
35
+ """SIC description."""
36
+ stock_exchange: Union[NoneType, "TickerExchange"] = None
37
+ comments: Union[NoneType, str] = None
38
+ """Additional comments."""
39
+ has_intraday: Union[NoneType, bool] = None
40
+ has_eod: Union[NoneType, bool] = None
41
+ country: Union[NoneType, str] = None
42
+
43
+
44
+ class TickerExchange(BaseModel):
45
+ """Stock exchange as embedded in ticker responses. Note: date fields serialize as objects here, unlike the /exchanges endpoints which return date strings."""
46
+
47
+ name: str
48
+ """Name of the stock exchange."""
49
+ acronym: Union[NoneType, str] = None
50
+ """Acronym of the stock exchange."""
51
+ mic: str
52
+ """MIC identification of the exchange."""
53
+ country: Union[NoneType, str] = None
54
+ """Country of the stock exchange."""
55
+ country_code: Union[NoneType, str] = None
56
+ """Three-letter country code of the exchange."""
57
+ city: Union[NoneType, str] = None
58
+ """City where the exchange is located."""
59
+ website: Union[NoneType, str] = None
60
+ """Website URL of the exchange."""
61
+ operating_mic: Union[NoneType, str] = None
62
+ """Operating Market Identifier Code."""
63
+ oprt_sgmt: Union[NoneType, str] = None
64
+ """Indicates operating MIC vs market segment MIC."""
65
+ legal_entity_name: Union[NoneType, str] = None
66
+ """Legal entity name."""
67
+ exchange_lei: Union[NoneType, str] = None
68
+ """Exchange Legal Entity Identifier (LEI)."""
69
+ market_category_code: Union[NoneType, str] = None
70
+ """Market category code."""
71
+ exchange_status: Union[NoneType, str] = None
72
+ """Current status of the exchange."""
73
+ date_creation: Union[NoneType, ExchangeDateTime] = None
74
+ date_last_update: Union[NoneType, ExchangeDateTime] = None
75
+ date_last_validation: Union[NoneType, ExchangeDateTime] = None
76
+ date_expiry: Union[NoneType, "TickerExchange_date_expiry"] = None
77
+
78
+
79
+ class TickerExchange_date_expiry(BaseModel):
80
+ """Expiry date (object or null)."""
81
+
82
+ date: str
83
+ timezone_type: int
84
+ timezone: str
85
+
86
+
87
+ class TickerEODRequest(PaginationRequest, total=False):
88
+ date_from: Union[NoneType, DateString] = None
89
+ """Filter results from a specific start date. [Format: YYYY-MM-DD]
90
+ """
91
+ date_to: Union[NoneType, DateString] = None
92
+ """Filter results up to a specific end date. [Format: YYYY-MM-DD]
93
+ """
94
+
95
+
96
+ class TickerEODResponse(BaseModel):
97
+ pagination: Pagniation
98
+ data: "TickerEODResponse_data"
99
+
100
+
101
+ class TickerEODResponse_data(BaseModel):
102
+ name: str
103
+ """Company or instrument name."""
104
+ symbol: str
105
+ """Ticker symbol."""
106
+ has_intraday: bool
107
+ """Indicates if intraday data is available."""
108
+ has_eod: bool
109
+ """Indicates if end-of-day data is available."""
110
+ country: Union[NoneType, str] = None
111
+ """Country of the ticker."""
112
+ eod: list[EODBar]
113
+
114
+
115
+ class TickerEODLatestRequest(PaginationRequest, total=False):
116
+ pass
117
+
118
+
119
+ class TickerSplitsRequest(PaginationRequest, total=False):
120
+ date_from: Union[NoneType, DateString] = None
121
+ """Filter results from a specific start date. [Format: YYYY-MM-DD]
122
+ """
123
+ date_to: Union[NoneType, DateString] = None
124
+ """Filter results up to a specific end date. [Format: YYYY-MM-DD]
125
+ """
126
+
127
+
128
+ class TickerSplitsResponse(BaseModel):
129
+ pagination: Pagniation
130
+ data: list["TickerSplitsResponse_data"]
131
+
132
+
133
+ class TickerSplitsResponse_data(BaseModel):
134
+ date: str
135
+ """Date of the split."""
136
+ split_factor: float
137
+ """Split ratio applied on the date."""
138
+ stock_split: Union[NoneType, str] = None
139
+ """Additional stock split info (nullable)."""
140
+ symbol: str
141
+ """Ticker symbol the split applies to."""
142
+
143
+
144
+ class TickerIntradayRequest(PaginationRequest, total=False):
145
+ interval: Union[NoneType, str] = None
146
+ """Interval for intraday data."""
147
+ after_hours: Union[NoneType, bool] = None
148
+ """Include after hours data."""
149
+ date_from: Union[NoneType, DateString] = None
150
+ """Filter results from a specific start date."""
151
+ date_to: Union[NoneType, DateString] = None
152
+ """Filter results up to a specific end date."""
153
+
154
+
155
+ class TickerDividendsRequest(PaginationRequest, total=False):
156
+ date_from: Union[NoneType, DateString] = None
157
+ """Filter results from a specific start date."""
158
+ date_to: Union[NoneType, DateString] = None
159
+ """Filter results up to a specific end date."""
@@ -0,0 +1,197 @@
1
+ from pydantic import BaseModel, Field
2
+ from typing import Union
3
+ from types import NoneType
4
+ from .pagination import Pagniation, PaginationRequest
5
+ from .ticker import TickerExchange
6
+ from .eod import EODBar
7
+ from .intraday import IntradayBar
8
+ from typing import TypedDict
9
+
10
+
11
+ class TickerInfoRequest(TypedDict, total=False):
12
+ ticker: Union[NoneType, str] = None
13
+ """Specify stock ticker symbol."""
14
+
15
+ class TickersListRequest(PaginationRequest, total=False):
16
+ search: Union[NoneType, str] = None
17
+ """Search for tickers."""
18
+ exchange: Union[NoneType, str] = None
19
+ """Filter by stock exchange."""
20
+
21
+ class Ticker(BaseModel):
22
+ name: str
23
+ """Company or instrument name."""
24
+ symbol: str
25
+ """Ticker symbol."""
26
+ has_intraday: bool
27
+ """Indicates if intraday data is available."""
28
+ has_eod: bool
29
+ """Indicates if end-of-day data is available."""
30
+ country: Union[NoneType, str] = None
31
+ """Country of the ticker."""
32
+ stock_exchanges: list["TickerExchange"]
33
+
34
+ class TickerInfoExecutive(BaseModel):
35
+ name: str
36
+ """Executive name."""
37
+ salary: str
38
+ """Executive salary."""
39
+ function: str
40
+ """Executive function/role."""
41
+ exercised: str
42
+ """Exercised options/shares."""
43
+ birth_year: str
44
+ """Birth year."""
45
+
46
+ class TickerInfoAddress(BaseModel):
47
+ """Postal address."""
48
+ city: Union[NoneType, str] = None
49
+ street1: Union[NoneType, str] = None
50
+ street2: Union[NoneType, str] = None
51
+ postal_code: Union[NoneType, str] = None
52
+ stateOrCountry: Union[NoneType, str] = None
53
+ state_or_country_description: Union[NoneType, str] = None
54
+
55
+ class TickerInfoExchange(BaseModel):
56
+ exchange_name: Union[NoneType, str] = None
57
+ acronym1: Union[NoneType, str] = None
58
+ exchange_mic: Union[NoneType, str] = None
59
+ alpha2_code: Union[NoneType, str] = None
60
+ country: Union[NoneType, str] = None
61
+ city: Union[NoneType, str] = None
62
+ website: Union[NoneType, str] = None
63
+
64
+ class TickerPreviousName(BaseModel):
65
+ name: Union[NoneType, str] = None
66
+ date_from: Union[NoneType, str] = Field(None, alias="from")
67
+
68
+ class TickerInfoData(BaseModel):
69
+ name: str
70
+ """Company or instrument name."""
71
+ ticker: str
72
+ """Ticker symbol."""
73
+ item_type: Union[NoneType, str] = None
74
+ """Type of item (e.g., equity)."""
75
+ sector: Union[NoneType, str] = None
76
+ """Sector of the company."""
77
+ industry: Union[NoneType, str] = None
78
+ """Industry of the company."""
79
+ exchange_code: Union[NoneType, str] = None
80
+ """Exchange code."""
81
+ full_time_employees: Union[NoneType, str] = None
82
+ """Number of full-time employees."""
83
+ ipo_date: Union[NoneType, str] = None
84
+ """IPO date."""
85
+ date_founded: Union[NoneType, str] = None
86
+ """Date founded."""
87
+ key_executives: list[TickerInfoExecutive] = []
88
+ incorporation: Union[NoneType, str] = None
89
+ """State or country of incorporation."""
90
+ incorporation_description: Union[NoneType, str] = None
91
+ """State or country of incorporation, described."""
92
+ start_fiscal: Union[NoneType, str] = None
93
+ """Fiscal year start (MM-DD)."""
94
+ end_fiscal: Union[NoneType, str] = None
95
+ """Fiscal year end (MM-DD)."""
96
+ mission: Union[NoneType, str] = None
97
+ """Company mission statement."""
98
+ vision: Union[NoneType, str] = None
99
+ """Company vision statement."""
100
+ previous_names: list[TickerPreviousName] = []
101
+ """Former names of the company."""
102
+ post_address: Union[NoneType, TickerInfoAddress] = None
103
+ """Postal address."""
104
+ stock_exchanges: list[TickerInfoExchange] = []
105
+ """Exchanges the ticker is listed on."""
106
+ reporting_currency: Union[NoneType, str] = None
107
+ """Reporting currency."""
108
+ address: Union[NoneType, TickerInfoAddress] = None
109
+ phone: Union[NoneType, str] = None
110
+ """Company phone number."""
111
+ website: Union[NoneType, str] = None
112
+ """Company website."""
113
+ about: Union[NoneType, str] = None
114
+ """Company description."""
115
+
116
+ class TickerInfoResponse(BaseModel):
117
+ data: TickerInfoData
118
+
119
+ class TickerIntradayData(BaseModel):
120
+ name: str
121
+ """Company or instrument name."""
122
+ symbol: str
123
+ """Ticker symbol."""
124
+ has_intraday: bool
125
+ """Indicates if intraday data is available."""
126
+ has_eod: bool
127
+ """Indicates if end-of-day data is available."""
128
+ country: Union[NoneType, str] = None
129
+ """Country of the ticker."""
130
+ intraday: list["IntradayBar"]
131
+
132
+ class TickerIntradayResponse(BaseModel):
133
+ pagination: Pagniation
134
+ data: "TickerIntradayData"
135
+
136
+ class TickerDividendItem(BaseModel):
137
+ date: str
138
+ """Ex-dividend date."""
139
+ dividend: float
140
+ """Dividend amount per share."""
141
+ payment_date: Union[NoneType, str] = None
142
+ """Payment date of the dividend."""
143
+ record_date: Union[NoneType, str] = None
144
+ """Record date for the dividend."""
145
+ declaration_date: Union[NoneType, str] = None
146
+ """Declaration date for the dividend."""
147
+ distr_freq: Union[NoneType, str] = None
148
+ """Distribution frequency (e.g., q for quarterly)."""
149
+ symbol: str
150
+ """Ticker symbol the dividend applies to."""
151
+
152
+ class TickerDividendsResponse(BaseModel):
153
+ pagination: Pagniation
154
+ data: list["TickerDividendItem"]
155
+
156
+ class TickerEodData(BaseModel):
157
+ name: str
158
+ """Company or instrument name."""
159
+ symbol: str
160
+ """Ticker symbol."""
161
+ has_intraday: bool
162
+ """Indicates if intraday data is available."""
163
+ has_eod: bool
164
+ """Indicates if end-of-day data is available."""
165
+ country: Union[NoneType, str] = None
166
+ """Country of the ticker."""
167
+ eod: list["EODBar"]
168
+
169
+ class TickerEodResponse(BaseModel):
170
+ pagination: Pagniation
171
+ data: "TickerEodData"
172
+
173
+ class TickerListItem(BaseModel):
174
+ name: str
175
+ """Company or instrument name."""
176
+ ticker: str
177
+ """Ticker symbol."""
178
+ has_intraday: bool
179
+ """Indicates if intraday data is available."""
180
+ has_eod: bool
181
+ """Indicates if end-of-day data is available."""
182
+ stock_exchange: "TickerExchange"
183
+
184
+ class TickersListResponse(BaseModel):
185
+ pagination: Pagniation
186
+ data: list[TickerListItem]
187
+
188
+
189
+ # Rebuild models to resolve forward references
190
+ TickerInfoResponse.model_rebuild()
191
+ TickerInfoData.model_rebuild()
192
+ TickersListResponse.model_rebuild()
193
+ TickerIntradayData.model_rebuild()
194
+ TickerIntradayResponse.model_rebuild()
195
+ TickerEodData.model_rebuild()
196
+ TickerEodResponse.model_rebuild()
197
+ TickerDividendsResponse.model_rebuild()
@@ -0,0 +1,21 @@
1
+ from pydantic import BaseModel
2
+ from typing import Union
3
+ from types import NoneType
4
+ from .pagination import Pagniation, PaginationRequest
5
+ from typing import TypedDict
6
+
7
+
8
+ class TimezonesRequest(PaginationRequest, total=False):
9
+ pass
10
+
11
+ class Timezone(BaseModel):
12
+ timezone: str
13
+ """IANA timezone name."""
14
+ abbr: str
15
+ """Standard time abbreviation."""
16
+ abbr_dst: str
17
+ """Daylight saving time abbreviation."""
18
+
19
+ class TimezonesResponse(BaseModel):
20
+ pagination: Pagniation
21
+ data: list["Timezone"]
File without changes
@@ -0,0 +1 @@
1
+ from .bond import Bond
@@ -0,0 +1,12 @@
1
+ from marketstack.client.http import HTTPClient
2
+ from typing import Unpack
3
+ from marketstack.models.bond import BondInfoResponse, BondRequest
4
+
5
+
6
+ class Bond:
7
+ def __init__(self, http_client: HTTPClient):
8
+ self.http_client = http_client
9
+
10
+ def get(self, **params: Unpack[BondRequest]) -> BondInfoResponse:
11
+ """Obtain bond information for a specific country."""
12
+ return BondInfoResponse.model_validate(self.http_client.get("/v2/bond", params=params))
@@ -0,0 +1 @@
1
+ from .bondlist import BondList
@@ -0,0 +1,12 @@
1
+ from marketstack.client.http import HTTPClient
2
+ from typing import Unpack
3
+ from marketstack.models.bond import BondListResponse, BondListRequest
4
+
5
+
6
+ class BondList:
7
+ def __init__(self, http_client: HTTPClient):
8
+ self.http_client = http_client
9
+
10
+ def list(self, **params: Unpack[BondListRequest]) -> BondListResponse:
11
+ """Obtain a list of supported bond countries."""
12
+ return BondListResponse.model_validate(self.http_client.get("/v2/bondlist", params=params))
@@ -0,0 +1 @@
1
+ from .cikcode import CIKCode
@@ -0,0 +1,12 @@
1
+ from marketstack.client.http import HTTPClient
2
+ from typing import Unpack
3
+ from marketstack.models.cik_code import CIKSearchResponse, CIKCodeRequest
4
+
5
+
6
+ class CIKCode:
7
+ def __init__(self, http_client: HTTPClient):
8
+ self.http_client = http_client
9
+
10
+ def search(self, **params: Unpack[CIKCodeRequest]) -> CIKSearchResponse:
11
+ """Search for a company by CIK code using company name."""
12
+ return CIKSearchResponse.model_validate(self.http_client.get("/v2/cik_code", params=params))
@@ -0,0 +1 @@
1
+ from .commodities import Commodities
@@ -0,0 +1,12 @@
1
+ from marketstack.client.http import HTTPClient
2
+ from typing import Unpack
3
+ from marketstack.models.commodity import CommodityResponse, CommoditiesRequest
4
+
5
+
6
+ class Commodities:
7
+ def __init__(self, http_client: HTTPClient):
8
+ self.http_client = http_client
9
+
10
+ def get(self, **params: Unpack[CommoditiesRequest]) -> CommodityResponse:
11
+ """Obtain commodity prices."""
12
+ return CommodityResponse.model_validate(self.http_client.get("/v2/commodities", params=params))
@@ -0,0 +1 @@
1
+ from .commoditieshistory import CommoditiesHistory
@@ -0,0 +1,12 @@
1
+ from marketstack.client.http import HTTPClient
2
+ from typing import Unpack
3
+ from marketstack.models.commodity import CommodityHistoricalResponse, CommoditiesHistoryRequest
4
+
5
+
6
+ class CommoditiesHistory:
7
+ def __init__(self, http_client: HTTPClient):
8
+ self.http_client = http_client
9
+
10
+ def get(self, **params: Unpack[CommoditiesHistoryRequest]) -> CommodityHistoricalResponse:
11
+ """Obtain commodity price history."""
12
+ return CommodityHistoricalResponse.model_validate(self.http_client.get("/v2/commoditieshistory", params=params))
@@ -0,0 +1 @@
1
+ from .company_facts import CompanyFacts
@@ -0,0 +1,12 @@
1
+ from marketstack.client.http import HTTPClient
2
+ from typing import Unpack
3
+ from marketstack.models.company import CompanyFactsByCIKResponse, CompanyFactsRequest
4
+
5
+
6
+ class CompanyFacts:
7
+ def __init__(self, http_client: HTTPClient):
8
+ self.http_client = http_client
9
+
10
+ def get(self, **params: Unpack[CompanyFactsRequest]) -> CompanyFactsByCIKResponse:
11
+ """Obtain company facts by CIK code."""
12
+ return CompanyFactsByCIKResponse.model_validate(self.http_client.get("/v2/company_facts", params=params))
@@ -0,0 +1 @@
1
+ from .companyname import CompanyName
@@ -0,0 +1,12 @@
1
+ from marketstack.client.http import HTTPClient
2
+ from typing import Unpack
3
+ from marketstack.models.company import CompanyNameByCIKResponse, CompanyNameRequest
4
+
5
+
6
+ class CompanyName:
7
+ def __init__(self, http_client: HTTPClient):
8
+ self.http_client = http_client
9
+
10
+ def get(self, **params: Unpack[CompanyNameRequest]) -> CompanyNameByCIKResponse:
11
+ """Search company by name/CIK code."""
12
+ return CompanyNameByCIKResponse.model_validate(self.http_client.get("/v2/company_name", params=params))
@@ -0,0 +1 @@
1
+ from .companyratings import CompanyRatings
@@ -0,0 +1,12 @@
1
+ from marketstack.client.http import HTTPClient
2
+ from typing import Unpack
3
+ from marketstack.models.company import CompanyRatingsResponse, CompanyRatingsRequest
4
+
5
+
6
+ class CompanyRatings:
7
+ def __init__(self, http_client: HTTPClient):
8
+ self.http_client = http_client
9
+
10
+ def get(self, **params: Unpack[CompanyRatingsRequest]) -> CompanyRatingsResponse:
11
+ """Obtain company ratings."""
12
+ return CompanyRatingsResponse.model_validate(self.http_client.get("/v2/companyratings", params=params))
@@ -0,0 +1 @@
1
+ from .concept import Concept
@@ -0,0 +1,12 @@
1
+ from marketstack.client.http import HTTPClient
2
+ from typing import Unpack
3
+ from marketstack.models.concept import AccountsPayableResponse, ConceptRequest
4
+
5
+
6
+ class Concept:
7
+ def __init__(self, http_client: HTTPClient):
8
+ self.http_client = http_client
9
+
10
+ def get_accounts_payable(self, **params: Unpack[ConceptRequest]) -> AccountsPayableResponse:
11
+ """Obtain accounts payable concept info."""
12
+ return AccountsPayableResponse.model_validate(self.http_client.get("/v2/concept/accounts_payable", params=params))
@@ -0,0 +1 @@
1
+ from .currencies import Currencies
@@ -0,0 +1,12 @@
1
+ from marketstack.client.http import HTTPClient
2
+ from typing import Unpack
3
+ from marketstack.models.currency import CurrenciesResponse, CurrenciesRequest
4
+
5
+
6
+ class Currencies:
7
+ def __init__(self, http_client: HTTPClient):
8
+ self.http_client = http_client
9
+
10
+ def list(self, **params: Unpack[CurrenciesRequest]) -> CurrenciesResponse:
11
+ """List supported currencies."""
12
+ return CurrenciesResponse.model_validate(self.http_client.get("/v2/currencies", params=params))
@@ -0,0 +1 @@
1
+ from .dividends import Dividends
@@ -0,0 +1,12 @@
1
+ from marketstack.client.http import HTTPClient
2
+ from typing import Unpack
3
+ from marketstack.models.dividend import DividendsResponse, DividendsRequest
4
+
5
+
6
+ class Dividends:
7
+ def __init__(self, http_client: HTTPClient):
8
+ self.http_client = http_client
9
+
10
+ def list(self, **params: Unpack[DividendsRequest]) -> DividendsResponse:
11
+ """List stock dividends."""
12
+ return DividendsResponse.model_validate(self.http_client.get("/v2/dividends", params=params))
@@ -0,0 +1 @@
1
+ from .eod import EOD
@@ -0,0 +1,20 @@
1
+ from marketstack.client.http import HTTPClient
2
+ from typing import Unpack
3
+ from marketstack.models.eod import EODResponse, EODRequest, EODLatestRequest
4
+
5
+
6
+ class EOD:
7
+ def __init__(self, http_client: HTTPClient):
8
+ self.http_client = http_client
9
+
10
+ def list(self, **params: Unpack[EODRequest]) -> EODResponse:
11
+ """Obtain end-of-day data."""
12
+ return EODResponse.model_validate(self.http_client.get("/v2/eod", params=params))
13
+
14
+ def latest(self, **params: Unpack[EODLatestRequest]) -> EODResponse:
15
+ """Obtain latest end-of-day data."""
16
+ return EODResponse.model_validate(self.http_client.get("/v2/eod/latest", params=params))
17
+
18
+ def for_a_date(self, date: str, **params: Unpack[EODRequest]) -> EODResponse:
19
+ """Obtain end-of-day data for a specific date."""
20
+ return EODResponse.model_validate(self.http_client.get(f"/v2/eod/{date}", params=params))
@@ -0,0 +1 @@
1
+ from .etfholdings import ETFHoldings
@@ -0,0 +1,12 @@
1
+ from marketstack.client.http import HTTPClient
2
+ from typing import Unpack
3
+ from marketstack.models.etf import ETFHoldingsResponse, ETFHoldingsRequest
4
+
5
+
6
+ class ETFHoldings:
7
+ def __init__(self, http_client: HTTPClient):
8
+ self.http_client = http_client
9
+
10
+ def get(self, **params: Unpack[ETFHoldingsRequest]) -> ETFHoldingsResponse:
11
+ """Obtain ETF Holdings."""
12
+ return ETFHoldingsResponse.model_validate(self.http_client.get("/v2/etfholdings", params=params))
@@ -0,0 +1 @@
1
+ from .etflist import ETFList
@@ -0,0 +1,12 @@
1
+ from marketstack.client.http import HTTPClient
2
+ from typing import Unpack
3
+ from marketstack.models.etf import ETFListResponse, ETFListRequest
4
+
5
+
6
+ class ETFList:
7
+ def __init__(self, http_client: HTTPClient):
8
+ self.http_client = http_client
9
+
10
+ def list(self, **params: Unpack[ETFListRequest]) -> ETFListResponse:
11
+ """List ETFs."""
12
+ return ETFListResponse.model_validate(self.http_client.get("/v2/etflist", params=params))
@@ -0,0 +1 @@
1
+ from .exchanges import Exchanges, ExchangeInstance, ExchangeEOD, ExchangeIntraday, ExchangeTickers