kensho-kfinance 2.0.0__py3-none-any.whl → 2.1.2__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.

Files changed (36) hide show
  1. {kensho_kfinance-2.0.0.dist-info → kensho_kfinance-2.1.2.dist-info}/METADATA +3 -1
  2. kensho_kfinance-2.1.2.dist-info/RECORD +43 -0
  3. {kensho_kfinance-2.0.0.dist-info → kensho_kfinance-2.1.2.dist-info}/WHEEL +1 -1
  4. kfinance/CHANGELOG.md +15 -0
  5. kfinance/batch_request_handling.py +10 -10
  6. kfinance/constants.py +16 -7
  7. kfinance/fetch.py +84 -40
  8. kfinance/kfinance.py +129 -28
  9. kfinance/meta_classes.py +9 -8
  10. kfinance/tests/conftest.py +32 -0
  11. kfinance/tests/test_batch_requests.py +13 -7
  12. kfinance/tests/test_client.py +54 -0
  13. kfinance/tests/test_fetch.py +8 -2
  14. kfinance/tests/test_group_objects.py +32 -0
  15. kfinance/tests/test_tools.py +1 -27
  16. kfinance/tool_calling/get_business_relationship_from_identifier.py +2 -1
  17. kfinance/tool_calling/get_capitalization_from_identifier.py +2 -1
  18. kfinance/tool_calling/get_company_id_from_identifier.py +2 -0
  19. kfinance/tool_calling/get_cusip_from_ticker.py +2 -0
  20. kfinance/tool_calling/get_earnings_call_datetimes_from_identifier.py +2 -0
  21. kfinance/tool_calling/get_financial_line_item_from_identifier.py +2 -1
  22. kfinance/tool_calling/get_financial_statement_from_identifier.py +2 -1
  23. kfinance/tool_calling/get_history_metadata_from_identifier.py +2 -1
  24. kfinance/tool_calling/get_info_from_identifier.py +2 -0
  25. kfinance/tool_calling/get_isin_from_ticker.py +2 -0
  26. kfinance/tool_calling/get_latest.py +2 -1
  27. kfinance/tool_calling/get_n_quarters_ago.py +2 -1
  28. kfinance/tool_calling/get_prices_from_identifier.py +2 -1
  29. kfinance/tool_calling/get_security_id_from_identifier.py +2 -0
  30. kfinance/tool_calling/get_trading_item_id_from_identifier.py +2 -0
  31. kfinance/tool_calling/shared_models.py +2 -0
  32. kfinance/version.py +2 -2
  33. kensho_kfinance-2.0.0.dist-info/RECORD +0 -40
  34. {kensho_kfinance-2.0.0.dist-info → kensho_kfinance-2.1.2.dist-info}/licenses/AUTHORS.md +0 -0
  35. {kensho_kfinance-2.0.0.dist-info → kensho_kfinance-2.1.2.dist-info}/licenses/LICENSE +0 -0
  36. {kensho_kfinance-2.0.0.dist-info → kensho_kfinance-2.1.2.dist-info}/top_level.txt +0 -0
@@ -2,6 +2,7 @@ from typing import Type
2
2
 
3
3
  from pydantic import BaseModel
4
4
 
5
+ from kfinance.constants import Permission
5
6
  from kfinance.tool_calling.shared_models import KfinanceTool, ToolArgsWithIdentifier
6
7
 
7
8
 
@@ -9,6 +10,7 @@ class GetInfoFromIdentifier(KfinanceTool):
9
10
  name: str = "get_info_from_identifier"
10
11
  description: str = "Get the information associated with an identifier. Info includes company name, status, type, simple industry, number of employees, founding date, webpage, HQ address, HQ city, HQ zip code, HQ state, HQ country, and HQ country iso code."
11
12
  args_schema: Type[BaseModel] = ToolArgsWithIdentifier
13
+ required_permission: Permission | None = None
12
14
 
13
15
  def _run(self, identifier: str) -> str:
14
16
  return str(self.kfinance_client.ticker(identifier).info)
@@ -2,6 +2,7 @@ from typing import Type
2
2
 
3
3
  from pydantic import BaseModel, Field
4
4
 
5
+ from kfinance.constants import Permission
5
6
  from kfinance.tool_calling.shared_models import KfinanceTool
6
7
 
7
8
 
@@ -13,6 +14,7 @@ class GetIsinFromTicker(KfinanceTool):
13
14
  name: str = "get_isin_from_ticker"
14
15
  description: str = "Get the ISIN associated with a ticker."
15
16
  args_schema: Type[BaseModel] = GetIsinFromTickerArgs
17
+ required_permission: Permission | None = Permission.IDPermission
16
18
 
17
19
  def _run(self, ticker_str: str) -> str:
18
20
  return self.kfinance_client.ticker(ticker_str).isin
@@ -2,7 +2,7 @@ from typing import Type
2
2
 
3
3
  from pydantic import BaseModel, Field
4
4
 
5
- from kfinance.constants import LatestPeriods
5
+ from kfinance.constants import LatestPeriods, Permission
6
6
  from kfinance.tool_calling.shared_models import KfinanceTool
7
7
 
8
8
 
@@ -16,6 +16,7 @@ class GetLatest(KfinanceTool):
16
16
  name: str = "get_latest"
17
17
  description: str = "Get the latest annual reporting year, latest quarterly reporting quarter and year, and current date."
18
18
  args_schema: Type[BaseModel] = GetLatestArgs
19
+ required_permission: Permission | None = None
19
20
 
20
21
  def _run(self, use_local_timezone: bool = True) -> LatestPeriods:
21
22
  return self.kfinance_client.get_latest(use_local_timezone=use_local_timezone)
@@ -2,7 +2,7 @@ from typing import Type
2
2
 
3
3
  from pydantic import BaseModel, Field
4
4
 
5
- from kfinance.constants import YearAndQuarter
5
+ from kfinance.constants import Permission, YearAndQuarter
6
6
  from kfinance.tool_calling.shared_models import KfinanceTool
7
7
 
8
8
 
@@ -16,6 +16,7 @@ class GetNQuartersAgo(KfinanceTool):
16
16
  "Get the year and quarter corresponding to [n] quarters before the current quarter."
17
17
  )
18
18
  args_schema: Type[BaseModel] = GetNQuartersAgoArgs
19
+ required_permission: Permission | None = None
19
20
 
20
21
  def _run(self, n: int) -> YearAndQuarter:
21
22
  return self.kfinance_client.get_n_quarters_ago(n)
@@ -3,7 +3,7 @@ from typing import Type
3
3
 
4
4
  from pydantic import BaseModel, Field
5
5
 
6
- from kfinance.constants import Periodicity
6
+ from kfinance.constants import Periodicity, Permission
7
7
  from kfinance.tool_calling.shared_models import KfinanceTool, ToolArgsWithIdentifier
8
8
 
9
9
 
@@ -26,6 +26,7 @@ class GetPricesFromIdentifier(KfinanceTool):
26
26
  name: str = "get_prices_from_identifier"
27
27
  description: str = "Get the historical open, high, low, and close prices, and volume of an identifier between inclusive start_date and inclusive end date. When requesting the most recent values, leave start_date and end_date empty."
28
28
  args_schema: Type[BaseModel] = GetPricesFromIdentifierArgs
29
+ required_permission: Permission | None = Permission.PricingPermission
29
30
 
30
31
  def _run(
31
32
  self,
@@ -2,6 +2,7 @@ from typing import Type
2
2
 
3
3
  from pydantic import BaseModel
4
4
 
5
+ from kfinance.constants import Permission
5
6
  from kfinance.tool_calling.shared_models import KfinanceTool, ToolArgsWithIdentifier
6
7
 
7
8
 
@@ -9,6 +10,7 @@ class GetSecurityIdFromIdentifier(KfinanceTool):
9
10
  name: str = "get_security_id_from_identifier"
10
11
  description: str = "Get the security id associated with an identifier."
11
12
  args_schema: Type[BaseModel] = ToolArgsWithIdentifier
13
+ required_permission: Permission | None = None
12
14
 
13
15
  def _run(self, identifier: str) -> int:
14
16
  return self.kfinance_client.ticker(identifier).security_id
@@ -2,6 +2,7 @@ from typing import Type
2
2
 
3
3
  from pydantic import BaseModel
4
4
 
5
+ from kfinance.constants import Permission
5
6
  from kfinance.tool_calling.shared_models import KfinanceTool, ToolArgsWithIdentifier
6
7
 
7
8
 
@@ -9,6 +10,7 @@ class GetTradingItemIdFromIdentifier(KfinanceTool):
9
10
  name: str = "get_trading_item_id_from_identifier"
10
11
  description: str = "Get the trading item id associated with an identifier."
11
12
  args_schema: Type[BaseModel] = ToolArgsWithIdentifier
13
+ required_permission: Permission | None = None
12
14
 
13
15
  def _run(self, identifier: str) -> int:
14
16
  return self.kfinance_client.ticker(identifier).trading_item_id
@@ -3,6 +3,7 @@ from typing import Any, Type
3
3
  from langchain_core.tools import BaseTool
4
4
  from pydantic import BaseModel, ConfigDict, Field
5
5
 
6
+ from kfinance.constants import Permission
6
7
  from kfinance.kfinance import Client
7
8
 
8
9
 
@@ -15,6 +16,7 @@ class KfinanceTool(BaseTool):
15
16
 
16
17
  kfinance_client: Client
17
18
  args_schema: Type[BaseModel]
19
+ required_permission: Permission | None
18
20
 
19
21
  model_config = ConfigDict(populate_by_name=True, extra="forbid")
20
22
 
kfinance/version.py CHANGED
@@ -17,5 +17,5 @@ __version__: str
17
17
  __version_tuple__: VERSION_TUPLE
18
18
  version_tuple: VERSION_TUPLE
19
19
 
20
- __version__ = version = '2.0.0'
21
- __version_tuple__ = version_tuple = (2, 0, 0)
20
+ __version__ = version = '2.1.2'
21
+ __version_tuple__ = version_tuple = (2, 1, 2)
@@ -1,40 +0,0 @@
1
- kensho_kfinance-2.0.0.dist-info/licenses/AUTHORS.md,sha256=0h9ClbI0pu1oKj1M28ROUsaxrbZg-6ukQGl6X4y9noI,68
2
- kensho_kfinance-2.0.0.dist-info/licenses/LICENSE,sha256=bsY4blvSgq6o0FMQ3RXa2NCgco--nHCCchLXzxr6kms,83
3
- kfinance/CHANGELOG.md,sha256=Gjau3iwqbJoOw-ReXpn9H3mkRhsWNTttBljc7D2-i4Y,641
4
- kfinance/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
5
- kfinance/batch_request_handling.py,sha256=s0uXRY4CC-GnShI0i8PLPgLddRdqLyQ8jnqDKdmaZzs,5531
6
- kfinance/constants.py,sha256=HrTh2QuhbA70xxcJ6N8WfTOJs6YiM30P59GbSDu_3AY,48312
7
- kfinance/fetch.py,sha256=ygvp8q1o8mqPYY4ctQwch37dmprO0UMDteDumk8A-Gw,20172
8
- kfinance/kfinance.py,sha256=nw2SPkixFht3PkcH4tZ1FnLhVxmyZm1_gbOqnmC6PBQ,49219
9
- kfinance/meta_classes.py,sha256=sNezG7uHAQOWj2Xdjao6qc3z_gHppgJat7O9J2k_yqI,15730
10
- kfinance/prompt.py,sha256=PtVB8c_FcSlVdyGgByAnIFGzuUuBaEjciCqnBJl1hSQ,25133
11
- kfinance/py.typed,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
12
- kfinance/server_thread.py,sha256=jUnt1YGoYDkqqz1MbCwd44zJs1T_Z2BCgvj75bdtLgA,2574
13
- kfinance/version.py,sha256=2thmcF9DS_Zp1zHI3N0kjBeMAuCP9mdDGnL0clqQpS8,511
14
- kfinance/tests/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
15
- kfinance/tests/test_batch_requests.py,sha256=NsldoZqjjQpv0QKM2th80F1nru2tIF4LJeXU-RamQvA,9836
16
- kfinance/tests/test_fetch.py,sha256=iJLOPBOb8xdAGF6Jel5jPhWb4iW6yPpt9f5tW4uZEyo,12189
17
- kfinance/tests/test_objects.py,sha256=egXkhfoK2MepZdXtrBxzWxWni7f-zVCefUbnyDnWDOE,22554
18
- kfinance/tests/test_tools.py,sha256=YG5UVWnR4EyHGsL4bBwUp2auSd55lcvUEEncXcMXw1Q,16941
19
- kfinance/tool_calling/README.md,sha256=omJq7Us6r4U45QB7hRpLjRJ5BMalCkZkh4uXBjTbJXc,2022
20
- kfinance/tool_calling/__init__.py,sha256=GDEeK2zM2tOfYam6ejwYACXecoRdlkRve_ZC5VTKugo,2038
21
- kfinance/tool_calling/get_business_relationship_from_identifier.py,sha256=S_-nCsppi9tvwC81GMKvJd-eZSwRejT96PZhlOf5Wv4,1381
22
- kfinance/tool_calling/get_capitalization_from_identifier.py,sha256=LmH5yEWSRJfAP4kRYHREdbMtrmxcZfgfbNB4dGQwyb4,1435
23
- kfinance/tool_calling/get_company_id_from_identifier.py,sha256=18XAmWxTXRw1qaqw4WuA-yQ4d7kI2HnbMi32d-xNGzE,485
24
- kfinance/tool_calling/get_cusip_from_ticker.py,sha256=uzVMbtcV4eKtWO4bYn-cicCo8tfAEGk-v95ZOON_cbA,533
25
- kfinance/tool_calling/get_earnings_call_datetimes_from_identifier.py,sha256=3v73ZZz9n-Rdp5vp1RPmFD41nJ0Z3EgTjFSbnm30xdA,665
26
- kfinance/tool_calling/get_financial_line_item_from_identifier.py,sha256=zJ-kcr_B9N3ZIXK1W-2TEUlF6tj4rhzmLSsW8EUhJn4,2064
27
- kfinance/tool_calling/get_financial_statement_from_identifier.py,sha256=LyGmh81-_yljOhMVpsXa1M4u6hNJNP69Ms1M1NsxwPM,1817
28
- kfinance/tool_calling/get_history_metadata_from_identifier.py,sha256=0h7xdhrIJg3pJJrrCgcsiZd3ft1GpConhNZe2pcOREA,666
29
- kfinance/tool_calling/get_info_from_identifier.py,sha256=bv4lRhXWG9N7U8XEli9v44QEXNgf7-ZTuTDmE6XIeEg,659
30
- kfinance/tool_calling/get_isin_from_ticker.py,sha256=yz7SOCFgwL03Zd8zG3pIfa3McB_tdRU-_oXYfSfqWoo,527
31
- kfinance/tool_calling/get_latest.py,sha256=U_5SuGlD0G-u7YreiNkwEtx2zkUhZzUvwUwdL_tmqFk,724
32
- kfinance/tool_calling/get_n_quarters_ago.py,sha256=VVKKyUNbmw7fS7e-vi4YXSdd_OO2bo8k50Grt5F_Mvo,651
33
- kfinance/tool_calling/get_prices_from_identifier.py,sha256=b-cK9dWXbVBjppTORlC4HK9zd_qe8V0n98s823v0dCc,1796
34
- kfinance/tool_calling/get_security_id_from_identifier.py,sha256=vPFYuFydUGxQ0b23CWkU3YxWVeoW-nzsrPbB9ZH8U_w,489
35
- kfinance/tool_calling/get_trading_item_id_from_identifier.py,sha256=fB8QBFzhn-kgUL8dSF6w_rtO3zG5yLbm5s29Xz6U1AY,504
36
- kfinance/tool_calling/shared_models.py,sha256=6y74yJCORHDVBxhhBJhTUOWCF9D11Lgg9eYQeDIT3aY,2047
37
- kensho_kfinance-2.0.0.dist-info/METADATA,sha256=g5E_LG0HZWOwX6V8Bd7OE4Eeu7HoD69scUh5QqH3hSs,3051
38
- kensho_kfinance-2.0.0.dist-info/WHEEL,sha256=SmOxYU7pzNKBqASvQJ7DjX3XGUF92lrGhMb3R6_iiqI,91
39
- kensho_kfinance-2.0.0.dist-info/top_level.txt,sha256=kT_kNwVhfQoOAecY8W7uYah5xaHMoHoAdBIvXh6DaKM,9
40
- kensho_kfinance-2.0.0.dist-info/RECORD,,