kensho-kfinance 1.2.2__py3-none-any.whl → 2.0.1__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.
Potentially problematic release.
This version of kensho-kfinance might be problematic. Click here for more details.
- {kensho_kfinance-1.2.2.dist-info → kensho_kfinance-2.0.1.dist-info}/METADATA +5 -3
- kensho_kfinance-2.0.1.dist-info/RECORD +40 -0
- {kensho_kfinance-1.2.2.dist-info → kensho_kfinance-2.0.1.dist-info}/WHEEL +1 -1
- kfinance/CHANGELOG.md +6 -0
- kfinance/constants.py +40 -8
- kfinance/fetch.py +15 -9
- kfinance/kfinance.py +128 -38
- kfinance/meta_classes.py +3 -9
- kfinance/tests/test_fetch.py +7 -6
- kfinance/tests/test_tools.py +430 -0
- kfinance/tool_calling/README.md +38 -0
- kfinance/tool_calling/__init__.py +47 -0
- kfinance/tool_calling/get_business_relationship_from_identifier.py +28 -0
- kfinance/tool_calling/get_capitalization_from_identifier.py +35 -0
- kfinance/tool_calling/get_company_id_from_identifier.py +14 -0
- kfinance/tool_calling/get_cusip_from_ticker.py +18 -0
- kfinance/tool_calling/get_earnings_call_datetimes_from_identifier.py +17 -0
- kfinance/tool_calling/get_financial_line_item_from_identifier.py +45 -0
- kfinance/tool_calling/get_financial_statement_from_identifier.py +41 -0
- kfinance/tool_calling/get_history_metadata_from_identifier.py +15 -0
- kfinance/tool_calling/get_info_from_identifier.py +14 -0
- kfinance/tool_calling/get_isin_from_ticker.py +18 -0
- kfinance/tool_calling/get_latest.py +21 -0
- kfinance/tool_calling/get_n_quarters_ago.py +21 -0
- kfinance/tool_calling/get_prices_from_identifier.py +44 -0
- kfinance/tool_calling/get_security_id_from_identifier.py +14 -0
- kfinance/tool_calling/get_trading_item_id_from_identifier.py +14 -0
- kfinance/tool_calling/shared_models.py +53 -0
- kfinance/version.py +2 -2
- kensho_kfinance-1.2.2.dist-info/RECORD +0 -23
- kfinance/llm_tools.py +0 -747
- kfinance/tool_schemas.py +0 -148
- {kensho_kfinance-1.2.2.dist-info → kensho_kfinance-2.0.1.dist-info}/licenses/AUTHORS.md +0 -0
- {kensho_kfinance-1.2.2.dist-info → kensho_kfinance-2.0.1.dist-info}/licenses/LICENSE +0 -0
- {kensho_kfinance-1.2.2.dist-info → kensho_kfinance-2.0.1.dist-info}/top_level.txt +0 -0
kfinance/tool_schemas.py
DELETED
|
@@ -1,148 +0,0 @@
|
|
|
1
|
-
from typing import Literal
|
|
2
|
-
|
|
3
|
-
from pydantic import BaseModel, Field
|
|
4
|
-
|
|
5
|
-
from .constants import LINE_ITEM_NAMES_AND_ALIASES, BusinessRelationshipType
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
class GetLatestInput(BaseModel):
|
|
9
|
-
use_local_timezone: bool = Field(
|
|
10
|
-
default=True, description="whether to use the local timezone of the user"
|
|
11
|
-
)
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
class GetNQuartersAgoInput(BaseModel):
|
|
15
|
-
n: int = Field(description="number of quarters before the current quarter")
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
class GetCompanyIdFromIdentifier(BaseModel):
|
|
19
|
-
identifier: str = Field(
|
|
20
|
-
description="The identifier, which can be a ticker symbol, ISIN, or CUSIP"
|
|
21
|
-
)
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
class GetSecurityIdFromIdentifier(BaseModel):
|
|
25
|
-
identifier: str = Field(
|
|
26
|
-
description="The identifier, which can be a ticker symbol, ISIN, or CUSIP"
|
|
27
|
-
)
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
class GetTradingItemIdFromIdentifier(BaseModel):
|
|
31
|
-
identifier: str = Field(
|
|
32
|
-
description="The identifier, which can be a ticker symbol, ISIN, or CUSIP"
|
|
33
|
-
)
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
class GetIsinFromTicker(BaseModel):
|
|
37
|
-
ticker_str: str = Field(description="The ticker")
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
class GetCusipFromTicker(BaseModel):
|
|
41
|
-
ticker_str: str = Field(description="The ticker")
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
class GetInfoFromIdentifier(BaseModel):
|
|
45
|
-
identifier: str = Field(
|
|
46
|
-
description="The identifier, which can be a ticker symbol, ISIN, or CUSIP"
|
|
47
|
-
)
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
class GetEarningsCallDatetimesFromIdentifier(BaseModel):
|
|
51
|
-
identifier: str = Field(
|
|
52
|
-
description="The identifier, which can be a ticker symbol, ISIN, or CUSIP"
|
|
53
|
-
)
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
class GetHistoryMetadataFromIdentifier(BaseModel):
|
|
57
|
-
identifier: str = Field(
|
|
58
|
-
description="The identifier, which can be a ticker symbol, ISIN, or CUSIP"
|
|
59
|
-
)
|
|
60
|
-
|
|
61
|
-
|
|
62
|
-
class GetPricesFromIdentifier(BaseModel):
|
|
63
|
-
identifier: str = Field(
|
|
64
|
-
description="The identifier, which can be a ticker symbol, ISIN, or CUSIP"
|
|
65
|
-
)
|
|
66
|
-
periodicity: Literal["day", "week", "month", "year"] = Field(
|
|
67
|
-
default="day",
|
|
68
|
-
description="The frequency or interval at which the historical data points are sampled or aggregated. Periodicity is not the same as the date range. The date range specifies the time span over which the data is retrieved, while periodicity determines how the data within that date range is aggregated, valid inputs are ['day', 'week', 'month', 'year'].",
|
|
69
|
-
)
|
|
70
|
-
adjusted: bool = Field(
|
|
71
|
-
description="Whether to retrieve adjusted prices that account for corporate actions such as dividends and splits."
|
|
72
|
-
)
|
|
73
|
-
start_date: str | None = Field(
|
|
74
|
-
default=None,
|
|
75
|
-
description="The start date for historical price retrieval in format YYYY-MM-DD",
|
|
76
|
-
)
|
|
77
|
-
end_date: str | None = Field(
|
|
78
|
-
default=None, description="The end date for historical price retrieval in format YYYY-MM-DD"
|
|
79
|
-
)
|
|
80
|
-
|
|
81
|
-
|
|
82
|
-
class GetCapitalizationFromIdentifier(BaseModel):
|
|
83
|
-
identifier: str = Field(
|
|
84
|
-
description="The identifier, which can be a ticker symbol, ISIN, or CUSIP"
|
|
85
|
-
)
|
|
86
|
-
capitalization: Literal["market_cap", "tev", "shares_outstanding"] = Field(
|
|
87
|
-
description="The capitalization to retrieve"
|
|
88
|
-
)
|
|
89
|
-
start_date: str | None = Field(
|
|
90
|
-
default=None,
|
|
91
|
-
description="The start date in format YYYY-MM-DD",
|
|
92
|
-
)
|
|
93
|
-
end_date: str | None = Field(default=None, description="The end date in format YYYY-MM-DD")
|
|
94
|
-
|
|
95
|
-
|
|
96
|
-
class GetFinancialStatementFromIdentifier(BaseModel):
|
|
97
|
-
identifier: str = Field(
|
|
98
|
-
description="The identifier, which can be a ticker symbol, ISIN, or CUSIP"
|
|
99
|
-
)
|
|
100
|
-
statement: Literal["balance_sheet", "income_statement", "cashflow"] = Field(
|
|
101
|
-
description="The type of financial statement, valid inputs are ['balance_sheet', 'income_statement', 'cashflow']"
|
|
102
|
-
)
|
|
103
|
-
period_type: Literal["annual", "quarterly", "ltm", "ytd"] | None = Field(
|
|
104
|
-
default=None,
|
|
105
|
-
description="time period type, valid inputs are ['annual', 'quarterly', 'ltm', 'ytd'].",
|
|
106
|
-
)
|
|
107
|
-
start_year: int | None = Field(
|
|
108
|
-
default=None, description="The starting year for the data range."
|
|
109
|
-
)
|
|
110
|
-
end_year: int | None = Field(default=None, description="The ending year for the data range.")
|
|
111
|
-
start_quarter: Literal[1, 2, 3, 4] | None = Field(
|
|
112
|
-
default=None, description="starting quarter, valid inputs are [1, 2, 3, 4]"
|
|
113
|
-
)
|
|
114
|
-
end_quarter: Literal[1, 2, 3, 4] | None = Field(
|
|
115
|
-
default=None, description="ending quarter, valid inputs are [1, 2, 3, 4]"
|
|
116
|
-
)
|
|
117
|
-
|
|
118
|
-
|
|
119
|
-
class GetFinancialLineItemFromIdentifier(BaseModel):
|
|
120
|
-
identifier: str = Field(
|
|
121
|
-
description="The identifier, which can be a ticker symbol, ISIN, or CUSIP"
|
|
122
|
-
)
|
|
123
|
-
line_item: Literal[tuple(LINE_ITEM_NAMES_AND_ALIASES)] = Field( # type: ignore
|
|
124
|
-
description="The type of financial line_item requested"
|
|
125
|
-
)
|
|
126
|
-
period_type: Literal["annual", "quarterly", "ltm", "ytd"] | None = Field(
|
|
127
|
-
default=None,
|
|
128
|
-
description="time period type, valid inputs are ['annual', 'quarterly', 'ltm', 'ytd']",
|
|
129
|
-
)
|
|
130
|
-
start_year: int | None = Field(
|
|
131
|
-
default=None, description="The starting year for the data range."
|
|
132
|
-
)
|
|
133
|
-
end_year: int | None = Field(default=None, description="The ending year for the data range.")
|
|
134
|
-
start_quarter: Literal[1, 2, 3, 4] | None = Field(
|
|
135
|
-
default=None, description="starting quarter, valid inputs are [1, 2, 3, 4]"
|
|
136
|
-
)
|
|
137
|
-
end_quarter: Literal[1, 2, 3, 4] | None = Field(
|
|
138
|
-
default=None, description="ending quarter, valid inputs are [1, 2, 3, 4]"
|
|
139
|
-
)
|
|
140
|
-
|
|
141
|
-
|
|
142
|
-
class GetBusinessRelationshipFromIdentifier(BaseModel):
|
|
143
|
-
identifier: str = Field(
|
|
144
|
-
description="The identifier, which can be a ticker symbol, ISIN, or CUSIP"
|
|
145
|
-
)
|
|
146
|
-
business_relationship: BusinessRelationshipType = Field(
|
|
147
|
-
description="The type of business relationship requested"
|
|
148
|
-
)
|
|
File without changes
|
|
File without changes
|
|
File without changes
|