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

@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.4
2
2
  Name: kensho-kfinance
3
- Version: 3.2.9
3
+ Version: 3.2.10
4
4
  Summary: Python CLI for kFinance
5
5
  Author-email: Luke Brown <luke.brown@kensho.com>, Michelle Keoy <michelle.keoy@kensho.com>, Keith Page <keith.page@kensho.com>, Matthew Rosen <matthew.rosen@kensho.com>, Nick Roshdieh <nick.roshdieh@kensho.com>
6
6
  Project-URL: source, https://github.com/kensho-technologies/kfinance
@@ -1,11 +1,11 @@
1
- kensho_kfinance-3.2.9.dist-info/licenses/AUTHORS.md,sha256=0h9ClbI0pu1oKj1M28ROUsaxrbZg-6ukQGl6X4y9noI,68
2
- kensho_kfinance-3.2.9.dist-info/licenses/LICENSE,sha256=bsY4blvSgq6o0FMQ3RXa2NCgco--nHCCchLXzxr6kms,83
3
- kfinance/CHANGELOG.md,sha256=Bmr-5uaCGmPyE6Io5wRAp9XtbTvirW4WEiezpVxBqeA,3331
1
+ kensho_kfinance-3.2.10.dist-info/licenses/AUTHORS.md,sha256=0h9ClbI0pu1oKj1M28ROUsaxrbZg-6ukQGl6X4y9noI,68
2
+ kensho_kfinance-3.2.10.dist-info/licenses/LICENSE,sha256=bsY4blvSgq6o0FMQ3RXa2NCgco--nHCCchLXzxr6kms,83
3
+ kfinance/CHANGELOG.md,sha256=3mgDixfg0ojmEr3D36QnfaFd8YZD5zeHkjA3NHBRm08,3388
4
4
  kfinance/__init__.py,sha256=AbpHGcgLb-kRsJGnwFEktk7uzpZOCcBY74-YBdrKVGs,1
5
5
  kfinance/conftest.py,sha256=FIZNQyfFbldyVmzaLfWbnMGh6RiC4MZwOVax6815_Ms,3754
6
6
  kfinance/mcp.py,sha256=LTzCIlqsDKRD-0Xcpa_P99-JmJ8duAneO_-GzM43kjw,424
7
7
  kfinance/py.typed,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
8
- kfinance/version.py,sha256=d825_zg1e75hjTXcJJrUYWF2PzVuogUemVjSrnFB5a8,704
8
+ kfinance/version.py,sha256=0Do_CqGpGkuLSWuqbzGC46drHfwvUEjSDoKQNrc0rss,706
9
9
  kfinance/client/README.md,sha256=DA5vg4uz1JmJNiqvYywrj46YNhOr584WO8L83Ysx_Mk,372
10
10
  kfinance/client/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
11
11
  kfinance/client/batch_request_handling.py,sha256=opwJJAU2JtqH-s4vt8wRqhH34MiU4tQP6Ng7K6b3upA,6561
@@ -43,9 +43,9 @@ kfinance/domains/capitalizations/tests/test_capitalization_tools.py,sha256=H43ml
43
43
  kfinance/domains/companies/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
44
44
  kfinance/domains/companies/company_identifiers.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
45
45
  kfinance/domains/companies/company_models.py,sha256=Ny0o5lB5e1gN3bSj8bVbfqg6ktgJrwn9-58sKO1bmXs,5060
46
- kfinance/domains/companies/company_tools.py,sha256=Vuyegx0fTM8snOj2Ywou2cgy8puxh1Ry2zTbT5i9ltk,8885
46
+ kfinance/domains/companies/company_tools.py,sha256=PGBKlOUGCCK6eqUK9EbiSznBDnbu2YhgMwnqu5WkoJo,9171
47
47
  kfinance/domains/companies/tests/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
48
- kfinance/domains/companies/tests/test_company_tools.py,sha256=6Gl3Sjg80Qri-TrP1UB8RgmgQ8LOAhVZ1nxevAZJAc4,5377
48
+ kfinance/domains/companies/tests/test_company_tools.py,sha256=ijZF6tWswvtD9YpjtGAPsS76nyOf6aaNPB_u_v-EAwQ,5587
49
49
  kfinance/domains/competitors/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
50
50
  kfinance/domains/competitors/competitor_models.py,sha256=HAEn2AzKZNusclsFzyAufpS-627RfRGL4Vw1AiT_Ek0,747
51
51
  kfinance/domains/competitors/competitor_tools.py,sha256=k1zyr03gbnIrQ8IaENaZlVE8RiiW_77MqnArWzKa02M,2524
@@ -106,9 +106,9 @@ kfinance/integrations/tool_calling/static_tools/tests/__init__.py,sha256=47DEQpj
106
106
  kfinance/integrations/tool_calling/static_tools/tests/test_get_lastest.py,sha256=MN2gx-Hhvfvwh9v6eL_d5Yrbb054q7How1tPdYQlPvg,1149
107
107
  kfinance/integrations/tool_calling/static_tools/tests/test_get_n_quarters_ago.py,sha256=BjlTgaNrI5Tv7SpTWz0Q8WucDLcQviCqVH2zgLpNpcM,856
108
108
  kfinance/integrations/tool_calling/tests/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
109
- kfinance/integrations/tool_calling/tests/test_tool_calling_models.py,sha256=FIusHU4kFmVPuh31Kn57_356tNNVMGTbHApMUFJOaGM,2724
109
+ kfinance/integrations/tool_calling/tests/test_tool_calling_models.py,sha256=5L8TpSVJmrjNzGcnERorpfeyrgLND_DL46ld5hVlcNw,2933
110
110
  kfinance/models/permission_models.py,sha256=G0so8ZOsD1YDsCM4he0z5R9M_shUbSRwD3hUDJdqZl0,635
111
- kensho_kfinance-3.2.9.dist-info/METADATA,sha256=mKEsNivUKkpEoAL43ulOOgv4tTDLUFOfeYCNak7x3VE,6197
112
- kensho_kfinance-3.2.9.dist-info/WHEEL,sha256=_zCd3N1l69ArxyTb8rzEoP9TpbYXkqRFSNOD5OuxnTs,91
113
- kensho_kfinance-3.2.9.dist-info/top_level.txt,sha256=kT_kNwVhfQoOAecY8W7uYah5xaHMoHoAdBIvXh6DaKM,9
114
- kensho_kfinance-3.2.9.dist-info/RECORD,,
111
+ kensho_kfinance-3.2.10.dist-info/METADATA,sha256=u2l7KD1wRwk071OyjYEXqr3N6ZgcvZNRPZQG0OjAqkg,6198
112
+ kensho_kfinance-3.2.10.dist-info/WHEEL,sha256=_zCd3N1l69ArxyTb8rzEoP9TpbYXkqRFSNOD5OuxnTs,91
113
+ kensho_kfinance-3.2.10.dist-info/top_level.txt,sha256=kT_kNwVhfQoOAecY8W7uYah5xaHMoHoAdBIvXh6DaKM,9
114
+ kensho_kfinance-3.2.10.dist-info/RECORD,,
kfinance/CHANGELOG.md CHANGED
@@ -1,10 +1,12 @@
1
1
  # Changelog
2
+ # 3.2.10
3
+ - Add CIQ company_id to GetInfoFromIdentifiersResp
2
4
 
3
5
  # v3.2.9
4
- - Updated tool descriptions for line items, segments, and statements to mention that all period-based inputs and outputs refer only to the calendar year.
6
+ - Update tool descriptions for line items, segments, and statements to mention that all period-based inputs and outputs refer only to the calendar year.
5
7
 
6
8
  # v3.2.8
7
- - Added support for None to LineItemResponse & empty behavior for line items, segments, and statements
9
+ - Add support for None to LineItemResponse & empty behavior for line items, segments, and statements
8
10
 
9
11
  # v3.2.7
10
12
  - Fix validator for UnifiedIdTripleResponse
@@ -5,7 +5,11 @@ from pydantic import BaseModel
5
5
 
6
6
  from kfinance.client.batch_request_handling import Task, process_tasks_in_thread_pool_executor
7
7
  from kfinance.client.permission_models import Permission
8
- from kfinance.domains.companies.company_models import CompanyDescriptions, CompanyOtherNames
8
+ from kfinance.domains.companies.company_models import (
9
+ COMPANY_ID_PREFIX,
10
+ CompanyDescriptions,
11
+ CompanyOtherNames,
12
+ )
9
13
  from kfinance.integrations.tool_calling.tool_calling_models import (
10
14
  KfinanceTool,
11
15
  ToolArgsWithIdentifiers,
@@ -20,7 +24,7 @@ class GetInfoFromIdentifiersResp(ToolRespWithErrors):
20
24
  class GetInfoFromIdentifiers(KfinanceTool):
21
25
  name: str = "get_info_from_identifiers"
22
26
  description: str = dedent("""
23
- Get the information associated with a list of identifiers. Info includes company name, status, type, simple industry, number of employees (if available), founding date, webpage, HQ address, HQ city, HQ zip code, HQ state, HQ country, and HQ country iso code.
27
+ Get the information associated with a list of identifiers. Info includes company name, status, type, simple industry, number of employees (if available), founding date, webpage, HQ address, HQ city, HQ zip code, HQ state, HQ country, HQ country iso code, and CIQ company_id.
24
28
 
25
29
  - When possible, pass multiple identifiers in a single call rather than making multiple calls.
26
30
  """).strip()
@@ -44,7 +48,8 @@ class GetInfoFromIdentifiers(KfinanceTool):
44
48
  "zip_code": "10041-0001",
45
49
  "state": "New York",
46
50
  "country": "United States",
47
- "iso_country": "USA"
51
+ "iso_country": "USA",
52
+ "company_id": "C_21719"
48
53
  }
49
54
  },
50
55
  "errors": [['No identification triple found for the provided identifier: NON-EXISTENT of type: ticker']
@@ -65,6 +70,10 @@ class GetInfoFromIdentifiers(KfinanceTool):
65
70
  info_responses: dict[str, dict] = process_tasks_in_thread_pool_executor(
66
71
  api_client=api_client, tasks=tasks
67
72
  )
73
+
74
+ for identifier, id_triple in id_triple_resp.identifiers_to_id_triples.items():
75
+ info_responses[identifier]["company_id"] = f"{COMPANY_ID_PREFIX}{id_triple.company_id}"
76
+
68
77
  return GetInfoFromIdentifiersResp(
69
78
  results=info_responses, errors=list(id_triple_resp.errors.values())
70
79
  )
@@ -2,6 +2,7 @@ from requests_mock import Mocker
2
2
 
3
3
  from kfinance.client.kfinance import Client
4
4
  from kfinance.conftest import SPGI_COMPANY_ID
5
+ from kfinance.domains.companies.company_models import COMPANY_ID_PREFIX
5
6
  from kfinance.domains.companies.company_tools import (
6
7
  GetCompanyDescriptionFromIdentifiers,
7
8
  GetCompanyDescriptionFromIdentifiersResp,
@@ -23,7 +24,11 @@ class TestGetInfoFromIdentifiers:
23
24
  THEN we get back info for SPGI and an error for the non-existent company
24
25
  """
25
26
 
26
- info_resp = {"name": "S&P Global Inc.", "status": "Operating"}
27
+ info_resp = {
28
+ "name": "S&P Global Inc.",
29
+ "status": "Operating",
30
+ "company_id": f"{COMPANY_ID_PREFIX}{SPGI_COMPANY_ID}",
31
+ }
27
32
  expected_response = GetInfoFromIdentifiersResp.model_validate(
28
33
  {
29
34
  "results": {"SPGI": info_resp},
@@ -32,6 +37,7 @@ class TestGetInfoFromIdentifiers:
32
37
  ],
33
38
  }
34
39
  )
40
+ del info_resp["company_id"]
35
41
  requests_mock.get(
36
42
  url=f"https://kfinance.kensho.com/api/v1/info/{SPGI_COMPANY_ID}",
37
43
  json=info_resp,
@@ -7,6 +7,7 @@ from requests_mock import Mocker
7
7
 
8
8
  from kfinance.client.kfinance import Client
9
9
  from kfinance.conftest import SPGI_COMPANY_ID
10
+ from kfinance.domains.companies.company_models import COMPANY_ID_PREFIX
10
11
  from kfinance.domains.companies.company_tools import (
11
12
  GetInfoFromIdentifiers,
12
13
  GetInfoFromIdentifiersResp,
@@ -25,7 +26,11 @@ class TestGetEndpointsFromToolCallsWithGrounding:
25
26
  """
26
27
 
27
28
  # truncated from the original
28
- resp_data = {"name": "S&P Global Inc.", "status": "Operating"}
29
+ resp_data = {
30
+ "name": "S&P Global Inc.",
31
+ "status": "Operating",
32
+ "company_id": f"{COMPANY_ID_PREFIX}{SPGI_COMPANY_ID}",
33
+ }
29
34
  resp_endpoint = [
30
35
  "https://kfinance.kensho.com/api/v1/ids",
31
36
  "https://kfinance.kensho.com/api/v1/info/21719",
@@ -34,7 +39,7 @@ class TestGetEndpointsFromToolCallsWithGrounding:
34
39
  "data": GetInfoFromIdentifiersResp.model_validate({"results": {"SPGI": resp_data}}),
35
40
  "endpoint_urls": resp_endpoint,
36
41
  }
37
-
42
+ del resp_data["company_id"]
38
43
  requests_mock.get(
39
44
  url=f"https://kfinance.kensho.com/api/v1/info/{SPGI_COMPANY_ID}",
40
45
  json=resp_data,
kfinance/version.py CHANGED
@@ -28,7 +28,7 @@ version_tuple: VERSION_TUPLE
28
28
  commit_id: COMMIT_ID
29
29
  __commit_id__: COMMIT_ID
30
30
 
31
- __version__ = version = '3.2.9'
32
- __version_tuple__ = version_tuple = (3, 2, 9)
31
+ __version__ = version = '3.2.10'
32
+ __version_tuple__ = version_tuple = (3, 2, 10)
33
33
 
34
34
  __commit_id__ = commit_id = None