kensho-kfinance 3.2.4__py3-none-any.whl → 4.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 (57) hide show
  1. {kensho_kfinance-3.2.4.dist-info → kensho_kfinance-4.0.0.dist-info}/METADATA +3 -3
  2. {kensho_kfinance-3.2.4.dist-info → kensho_kfinance-4.0.0.dist-info}/RECORD +57 -56
  3. kfinance/CHANGELOG.md +51 -0
  4. kfinance/client/batch_request_handling.py +3 -1
  5. kfinance/client/fetch.py +127 -54
  6. kfinance/client/kfinance.py +38 -39
  7. kfinance/client/meta_classes.py +50 -20
  8. kfinance/client/models/date_and_period_models.py +32 -7
  9. kfinance/client/models/decimal_with_unit.py +14 -2
  10. kfinance/client/models/response_models.py +33 -0
  11. kfinance/client/models/tests/test_decimal_with_unit.py +9 -0
  12. kfinance/client/tests/test_batch_requests.py +5 -4
  13. kfinance/client/tests/test_fetch.py +134 -58
  14. kfinance/client/tests/test_objects.py +207 -145
  15. kfinance/conftest.py +10 -0
  16. kfinance/domains/business_relationships/business_relationship_tools.py +17 -8
  17. kfinance/domains/business_relationships/tests/test_business_relationship_tools.py +18 -16
  18. kfinance/domains/capitalizations/capitalization_models.py +7 -5
  19. kfinance/domains/capitalizations/capitalization_tools.py +38 -20
  20. kfinance/domains/capitalizations/tests/test_capitalization_tools.py +66 -36
  21. kfinance/domains/companies/company_models.py +22 -2
  22. kfinance/domains/companies/company_tools.py +49 -16
  23. kfinance/domains/companies/tests/test_company_tools.py +27 -9
  24. kfinance/domains/competitors/competitor_tools.py +19 -5
  25. kfinance/domains/competitors/tests/test_competitor_tools.py +22 -19
  26. kfinance/domains/cusip_and_isin/cusip_and_isin_tools.py +29 -8
  27. kfinance/domains/cusip_and_isin/tests/test_cusip_and_isin_tools.py +13 -8
  28. kfinance/domains/earnings/earning_tools.py +73 -29
  29. kfinance/domains/earnings/tests/test_earnings_tools.py +52 -43
  30. kfinance/domains/line_items/line_item_models.py +372 -16
  31. kfinance/domains/line_items/line_item_tools.py +198 -46
  32. kfinance/domains/line_items/tests/test_line_item_tools.py +305 -39
  33. kfinance/domains/mergers_and_acquisitions/merger_and_acquisition_models.py +46 -2
  34. kfinance/domains/mergers_and_acquisitions/merger_and_acquisition_tools.py +55 -74
  35. kfinance/domains/mergers_and_acquisitions/tests/test_merger_and_acquisition_tools.py +61 -59
  36. kfinance/domains/prices/price_models.py +7 -6
  37. kfinance/domains/prices/price_tools.py +24 -16
  38. kfinance/domains/prices/tests/test_price_tools.py +47 -39
  39. kfinance/domains/segments/segment_models.py +17 -3
  40. kfinance/domains/segments/segment_tools.py +102 -42
  41. kfinance/domains/segments/tests/test_segment_tools.py +166 -37
  42. kfinance/domains/statements/statement_models.py +17 -3
  43. kfinance/domains/statements/statement_tools.py +130 -46
  44. kfinance/domains/statements/tests/test_statement_tools.py +251 -49
  45. kfinance/integrations/local_mcp/kfinance_mcp.py +1 -1
  46. kfinance/integrations/tests/test_example_notebook.py +57 -16
  47. kfinance/integrations/tool_calling/all_tools.py +5 -1
  48. kfinance/integrations/tool_calling/static_tools/get_n_quarters_ago.py +5 -0
  49. kfinance/integrations/tool_calling/static_tools/tests/test_get_lastest.py +13 -10
  50. kfinance/integrations/tool_calling/static_tools/tests/test_get_n_quarters_ago.py +2 -1
  51. kfinance/integrations/tool_calling/tests/test_tool_calling_models.py +15 -4
  52. kfinance/integrations/tool_calling/tool_calling_models.py +18 -6
  53. kfinance/version.py +2 -2
  54. {kensho_kfinance-3.2.4.dist-info → kensho_kfinance-4.0.0.dist-info}/WHEEL +0 -0
  55. {kensho_kfinance-3.2.4.dist-info → kensho_kfinance-4.0.0.dist-info}/licenses/AUTHORS.md +0 -0
  56. {kensho_kfinance-3.2.4.dist-info → kensho_kfinance-4.0.0.dist-info}/licenses/LICENSE +0 -0
  57. {kensho_kfinance-3.2.4.dist-info → kensho_kfinance-4.0.0.dist-info}/top_level.txt +0 -0
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.4
2
2
  Name: kensho-kfinance
3
- Version: 3.2.4
3
+ Version: 4.0.0
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
@@ -12,9 +12,9 @@ Requires-Python: >=3.10
12
12
  Description-Content-Type: text/markdown
13
13
  License-File: LICENSE
14
14
  License-File: AUTHORS.md
15
- Requires-Dist: cachetools<6,>=5.5
15
+ Requires-Dist: cachetools<7,>=6
16
16
  Requires-Dist: click<=9,>=8.2.1
17
- Requires-Dist: fastmcp>=2.11
17
+ Requires-Dist: fastmcp<2.14,>=2.13.1
18
18
  Requires-Dist: langchain-core>=0.3.15
19
19
  Requires-Dist: langchain-google-genai<3,>=2.1.5
20
20
  Requires-Dist: numpy>=1.22.4
@@ -1,114 +1,115 @@
1
- kensho_kfinance-3.2.4.dist-info/licenses/AUTHORS.md,sha256=0h9ClbI0pu1oKj1M28ROUsaxrbZg-6ukQGl6X4y9noI,68
2
- kensho_kfinance-3.2.4.dist-info/licenses/LICENSE,sha256=bsY4blvSgq6o0FMQ3RXa2NCgco--nHCCchLXzxr6kms,83
3
- kfinance/CHANGELOG.md,sha256=X2CjISKbQr2oXL2f3r3X_grVSulqoOKOcaOfISxR_ls,2895
1
+ kensho_kfinance-4.0.0.dist-info/licenses/AUTHORS.md,sha256=0h9ClbI0pu1oKj1M28ROUsaxrbZg-6ukQGl6X4y9noI,68
2
+ kensho_kfinance-4.0.0.dist-info/licenses/LICENSE,sha256=bsY4blvSgq6o0FMQ3RXa2NCgco--nHCCchLXzxr6kms,83
3
+ kfinance/CHANGELOG.md,sha256=vU1C3H0fGyZdr5efTcb6T5zQZF9BgqvNznH_SNlh4uI,4246
4
4
  kfinance/__init__.py,sha256=AbpHGcgLb-kRsJGnwFEktk7uzpZOCcBY74-YBdrKVGs,1
5
- kfinance/conftest.py,sha256=FIZNQyfFbldyVmzaLfWbnMGh6RiC4MZwOVax6815_Ms,3754
5
+ kfinance/conftest.py,sha256=PFflyOx08XgmEA0rdugud7QEA7KqARmd22SH2dLTqrE,4091
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=l9_iMqlxiCOGrY70L8JWiTjDNINwByOH0aKGS6QXJ4I,704
8
+ kfinance/version.py,sha256=QKIQLQcx5S9GHF_rplWSVpBW_nVDWWvM96YNckz0xJI,704
9
9
  kfinance/client/README.md,sha256=DA5vg4uz1JmJNiqvYywrj46YNhOr584WO8L83Ysx_Mk,372
10
10
  kfinance/client/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
11
- kfinance/client/batch_request_handling.py,sha256=opwJJAU2JtqH-s4vt8wRqhH34MiU4tQP6Ng7K6b3upA,6561
12
- kfinance/client/fetch.py,sha256=JKw09G8P9jMw6qwVY4E-SAOW1YhZqVzOkirh0Nu8g9o,29336
11
+ kfinance/client/batch_request_handling.py,sha256=0r9x3-vXdpyKhfsIa6VZ9hovN60t3HB7nE3v5hnrSyI,6617
12
+ kfinance/client/fetch.py,sha256=Ywlv3soygi3c7ZLhqPjRXNlnB_5rfu00xh_c45O4hO0,31570
13
13
  kfinance/client/industry_models.py,sha256=ydB_cTIsNsfCUeaO7K2qqLUuHdG6WfUCoAzBigKVV8M,243
14
- kfinance/client/kfinance.py,sha256=9BMhXfmw5WzNl-xFdLvkvgJIr585F5rlM7YePwtlW7s,72684
15
- kfinance/client/meta_classes.py,sha256=O0qoz1ALveS25GgOVOfMjjsw0gl9gojpiLCfF-a8xsY,23622
14
+ kfinance/client/kfinance.py,sha256=-tyw9-pcP9gag20OTaOO8HpwQRae3iOuFqQ3PqzWagQ,72290
15
+ kfinance/client/meta_classes.py,sha256=E2U-IBGq5kq6r44vddKCo_KYuJ3HGEQgOGNrvlzb9ew,24720
16
16
  kfinance/client/permission_models.py,sha256=6pvoxRz5QGYvkSih_rrlBh4Yf5ltxTD1aeP5a6wCuRw,703
17
17
  kfinance/client/server_thread.py,sha256=jUnt1YGoYDkqqz1MbCwd44zJs1T_Z2BCgvj75bdtLgA,2574
18
18
  kfinance/client/models/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
19
19
  kfinance/client/models/currency_models.py,sha256=JfDZf-nATCyjThBw-Ky2BNvM-n2oHepBLIHMCIyCRUE,19201
20
- kfinance/client/models/date_and_period_models.py,sha256=B508v1SLy_mbSSuSbPz41xeFNRAeBFv41gJSlaXyHnU,1062
21
- kfinance/client/models/decimal_with_unit.py,sha256=lfBvOQDk1cdWnqRh7oZoXe3_TbjNsbaV31KyosH_OoY,2911
20
+ kfinance/client/models/date_and_period_models.py,sha256=mpaawWVkaN3BlLKnfTrI-ewJbRapoJf1ZZeraTAoYV8,1671
21
+ kfinance/client/models/decimal_with_unit.py,sha256=Kf-GftBl3hVsFbKVR-FhW9c44YaAc9nib07w8JkeahE,3343
22
+ kfinance/client/models/response_models.py,sha256=4U8IP_t4TooFFizdbpANlK6JDWQt7syWbPpsxmWml2E,963
22
23
  kfinance/client/models/tests/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
23
- kfinance/client/models/tests/test_decimal_with_unit.py,sha256=7WlmVXFOFNHFqwsvXQvcgyPfa6noRm3-mLTcXz4GvRs,2202
24
+ kfinance/client/models/tests/test_decimal_with_unit.py,sha256=3Az_DZXTRQaxLddDCQrlD-XwU_ywGRWk3dXDzqFpBjc,2593
24
25
  kfinance/client/tests/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
25
- kfinance/client/tests/test_batch_requests.py,sha256=KcE5rNJHBP27xaZOmwg8cVyUMZAAPt6jDiCeq94wUUk,11661
26
+ kfinance/client/tests/test_batch_requests.py,sha256=_V7GS7qbj_sRW49USgfp68TlYToUweruQWtQ8QwaEcg,11740
26
27
  kfinance/client/tests/test_client.py,sha256=GlK89ZOGL9bwrAUFUk8nua2ooKt0JYm7o_rpAfajFXA,4312
27
- kfinance/client/tests/test_fetch.py,sha256=nFVQ3hHn7gqe7ecTYRviRxLuf06QyFZegfDLLOSUpR8,21569
28
+ kfinance/client/tests/test_fetch.py,sha256=Wm6ZzfhUZTiWm5zTSpcZMBPeDfsxWDJRrB-HNeyzCiI,23938
28
29
  kfinance/client/tests/test_group_objects.py,sha256=wb7MEyGm-Qya3CXWM5Xz3kUhKFWdHT8FF3cQcjt1WxQ,1696
29
- kfinance/client/tests/test_objects.py,sha256=eAEy1kAHS6JQDoXVU5uSyTQpV099F3xFZsbvgspWMn8,42623
30
+ kfinance/client/tests/test_objects.py,sha256=iT87tXGX49xvw1H1QmHN1XRSTwGoiLySjFLSfofvaow,45163
30
31
  kfinance/domains/README.md,sha256=ehD15VwLupdXbz5M7hHUI7Y-2SCGxaP5W7Q4NuMcN64,664
31
32
  kfinance/domains/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
32
33
  kfinance/domains/business_relationships/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
33
34
  kfinance/domains/business_relationships/business_relationship_models.py,sha256=6uJKR7pfPBwlfn8YLuZOt7Jagg0Gv1bHefXrOJ9Ef20,1080
34
- kfinance/domains/business_relationships/business_relationship_tools.py,sha256=2FqR4eRe99SmyuGQjYdxIwUfzUvq25A21QT_cXL_HOg,3337
35
+ kfinance/domains/business_relationships/business_relationship_tools.py,sha256=lkQ5bj7CML-d2HnwDMQDymuirNhH1R17F7UjISn8juU,3871
35
36
  kfinance/domains/business_relationships/tests/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
36
- kfinance/domains/business_relationships/tests/test_business_relationship_tools.py,sha256=33x4ZmNS_VcbI6IMJ14JcSjdnKkeTOjtS_rP9aujfpM,2366
37
+ kfinance/domains/business_relationships/tests/test_business_relationship_tools.py,sha256=e_EGtM4i5Qw5J1Wi2kXahkyjDA4mhHcT0DFAKA5JQdI,2459
37
38
  kfinance/domains/capitalizations/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
38
- kfinance/domains/capitalizations/capitalization_models.py,sha256=2P0W48aZBfg5bG97PxyoHdcxdrdx7ZRKQ9TztyT1HNI,3361
39
- kfinance/domains/capitalizations/capitalization_tools.py,sha256=-CM93IiGjsXg90ygUvxsj7d09CQ9nTvp7aGxedMEqo0,4703
39
+ kfinance/domains/capitalizations/capitalization_models.py,sha256=uXHtu_4lpKUJiYA-s2UbmjImCzpNKmfrMgi3zlbBDsU,3507
40
+ kfinance/domains/capitalizations/capitalization_tools.py,sha256=7s8TTGwm9KUYzowvQL-HzJ9h9NyA1ejIVzVUioOa9as,6143
40
41
  kfinance/domains/capitalizations/tests/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
41
42
  kfinance/domains/capitalizations/tests/test_capitalization_models.py,sha256=SSFxEVnSLvuNjOK-gx4I3OCHso80OA37zOLmiHJhsro,3143
42
- kfinance/domains/capitalizations/tests/test_capitalization_tools.py,sha256=LDjFiEEax2O65HQ65CY73J3y4RvuKjw5pqBO5imoUyY,4187
43
+ kfinance/domains/capitalizations/tests/test_capitalization_tools.py,sha256=tetZXL6YqC9g5KKcEf0O88FiBei4Bz3UFflleWsMZnk,5384
43
44
  kfinance/domains/companies/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
44
45
  kfinance/domains/companies/company_identifiers.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
45
- kfinance/domains/companies/company_models.py,sha256=ez87FsQlpYvAmd668sAgSbdgFum4PjMisN59J4vkqNo,4819
46
- kfinance/domains/companies/company_tools.py,sha256=wwhB98fg8mKOJp1kvN-KKFhKurLx6F6KX3BfLPJkWP0,8984
46
+ kfinance/domains/companies/company_models.py,sha256=WBTcXx_XahzfO2wQeqcg_aX6QsrYOSgJL56nhE-V4do,5732
47
+ kfinance/domains/companies/company_tools.py,sha256=5wPb0M0z2tb9pqx8JAHSn78YURh8TBkP4CZZFXJgrIQ,10469
47
48
  kfinance/domains/companies/tests/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
48
- kfinance/domains/companies/tests/test_company_tools.py,sha256=i9_P5mf92wZv_mcnWhK5L8BjbBLfsuBtxPLcgPOyHzE,4895
49
+ kfinance/domains/companies/tests/test_company_tools.py,sha256=ijZF6tWswvtD9YpjtGAPsS76nyOf6aaNPB_u_v-EAwQ,5587
49
50
  kfinance/domains/competitors/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
50
51
  kfinance/domains/competitors/competitor_models.py,sha256=HAEn2AzKZNusclsFzyAufpS-627RfRGL4Vw1AiT_Ek0,747
51
- kfinance/domains/competitors/competitor_tools.py,sha256=W_vRMng5UG1csJWDZKDxibrvXzUcwwnN9hw5cSg4EHI,2551
52
+ kfinance/domains/competitors/competitor_tools.py,sha256=PukddUzW4tfBR0DTWGBkoa6LWCSm7lYq70x9hXD3Wks,3370
52
53
  kfinance/domains/competitors/tests/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
53
- kfinance/domains/competitors/tests/test_competitor_tools.py,sha256=GL03SBGU2XKejh6Y1F1wwtvNLmoOLGxuysLAHO0khRU,2377
54
+ kfinance/domains/competitors/tests/test_competitor_tools.py,sha256=o7y4huxc5DUTNBm5HO-QArr-X9wEcXtsX5umuQ3owz4,2552
54
55
  kfinance/domains/cusip_and_isin/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
55
- kfinance/domains/cusip_and_isin/cusip_and_isin_tools.py,sha256=G9wASgsa_RN9wC1jjTJcVzGXnmYehAwNeJ1HyOts3wg,3469
56
+ kfinance/domains/cusip_and_isin/cusip_and_isin_tools.py,sha256=E3ISlFKut9Vd8y_VlWiyiG9JLLiJSl9vyGp2fSCjQH0,4215
56
57
  kfinance/domains/cusip_and_isin/tests/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
57
- kfinance/domains/cusip_and_isin/tests/test_cusip_and_isin_tools.py,sha256=lEVgf6Bf54ddOAisutC5wZjtePGvM_-HPb5xY6Y7MqU,2252
58
+ kfinance/domains/cusip_and_isin/tests/test_cusip_and_isin_tools.py,sha256=lnFOkMLvbszSMwTHNaJyxsjLgAPwsYczrhyPjCDdoVQ,2459
58
59
  kfinance/domains/earnings/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
59
60
  kfinance/domains/earnings/earning_models.py,sha256=3iPnjx3n511wqwSVB9_FMJ1ceCgIURnKpc3hwr9fIjY,1197
60
- kfinance/domains/earnings/earning_tools.py,sha256=2yhb8PK56bXHQZ3EGL9-645t56FgMTLbVooFklBD8OE,6900
61
+ kfinance/domains/earnings/earning_tools.py,sha256=diaNqVw1v1Y9MdipLPkNF4UpB6TRcvSax5L0RpEWgow,9067
61
62
  kfinance/domains/earnings/tests/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
62
- kfinance/domains/earnings/tests/test_earnings_tools.py,sha256=HmCaDW5a7gKWu2tKRrgjCX0xYk6FdoQBbNfGp2lwaiI,6462
63
+ kfinance/domains/earnings/tests/test_earnings_tools.py,sha256=qGhdWI1s4uEjF6XtFC0f1nlAths1H6xfym-iJyBpwBo,6998
63
64
  kfinance/domains/line_items/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
64
- kfinance/domains/line_items/line_item_models.py,sha256=09JnV2RRxl-rSmZEVlKRfEwD-5-zYmvsUAIkmz9gFqc,45530
65
- kfinance/domains/line_items/line_item_tools.py,sha256=C-E7W1cNSYRtqXp1ULAaXcxMh64alcEwhOMAarNo6uk,4954
65
+ kfinance/domains/line_items/line_item_models.py,sha256=keTnwZJq6ETfBvnDz3lERH6BKoWlXDNrv2L2TV85cDs,66371
66
+ kfinance/domains/line_items/line_item_tools.py,sha256=3WuT4JqZfFwUPJmOe0V2Fpx8VPRp33_bvWNsL6Ihuaw,12108
66
67
  kfinance/domains/line_items/tests/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
67
- kfinance/domains/line_items/tests/test_line_item_tools.py,sha256=kZXbi_2oaR5cxxQk9Qj7pY0bvL7G3ch9-z9mprvxMGo,4106
68
+ kfinance/domains/line_items/tests/test_line_item_tools.py,sha256=D2FICF48XY8QNvK3gG4Cv_Y1_to4ojbe43DI7Y6_a8Y,15272
68
69
  kfinance/domains/mergers_and_acquisitions/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
69
- kfinance/domains/mergers_and_acquisitions/merger_and_acquisition_models.py,sha256=hJ87rnRj14FpmeEJDmEXLdUv37pBrcpKSWtb19j_vLQ,418
70
- kfinance/domains/mergers_and_acquisitions/merger_and_acquisition_tools.py,sha256=8cTI5E6nAUbC45xFshIkNrICjujGo99Ane2xW8Y0IEo,9735
70
+ kfinance/domains/mergers_and_acquisitions/merger_and_acquisition_models.py,sha256=WAWyBCgYMZj8NLz6nq_sW5MRg_UU5_F9jUUoQ_bcmsM,1893
71
+ kfinance/domains/mergers_and_acquisitions/merger_and_acquisition_tools.py,sha256=Ld2puPVLxICFHQPhYD26k3e82jNLqpfIW_PUTf4OKMs,8430
71
72
  kfinance/domains/mergers_and_acquisitions/tests/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
72
- kfinance/domains/mergers_and_acquisitions/tests/test_merger_and_acquisition_tools.py,sha256=ad4vv3qevHAaLZI0t5qEUPqEKTQm-e800ybA2ID5S_o,6640
73
+ kfinance/domains/mergers_and_acquisitions/tests/test_merger_and_acquisition_tools.py,sha256=uN9LewN_k4yy5IPR0lbeyYxi8UF2mmebOF3gvXCSt6M,6383
73
74
  kfinance/domains/prices/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
74
- kfinance/domains/prices/price_models.py,sha256=6K2Yi8PQKJ92rf6ulcOSh9rBVOiPcUQD_WIRjpIRuSo,2156
75
- kfinance/domains/prices/price_tools.py,sha256=KrcJz3GT8iQElfLp0pArVVcV-jckX_Ggj4lgO0s3wkE,7192
75
+ kfinance/domains/prices/price_models.py,sha256=OMGrrT-jQ_4HXuouWih9g5bFnIj_ecw6waK3t0YQ9o0,2292
76
+ kfinance/domains/prices/price_tools.py,sha256=f9hCXOEEMdNhEgkEY5FEj7hWmn8q_cmbONucfj8mebw,8038
76
77
  kfinance/domains/prices/tests/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
77
78
  kfinance/domains/prices/tests/test_price_models.py,sha256=PWGqbR9aCys2ldHZMF5anMXsSYEVOjgygfpxLcLVKL8,2400
78
- kfinance/domains/prices/tests/test_price_tools.py,sha256=2jCx79TyqZ7naKQrHm421vDX3zBgj-0kaas1TX5LpfA,5995
79
+ kfinance/domains/prices/tests/test_price_tools.py,sha256=xNuzAzeu1KuhkB0xF2oIYLVZub9uDg8VLRNmKq-iJ3s,6426
79
80
  kfinance/domains/segments/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
80
- kfinance/domains/segments/segment_models.py,sha256=CEZK_B9WM0eppsOpjUbt-ILIcLkQMYgVq4TAx_SrPlc,262
81
- kfinance/domains/segments/segment_tools.py,sha256=1YH1dQn--Dp7nYapBSeYnWEhsbc52wN1qMpCG8yrd4Q,4364
81
+ kfinance/domains/segments/segment_models.py,sha256=9R69VS0SKadO7wp7XiFQmKEJJkBrlWkFm5nL8M4qkoE,615
82
+ kfinance/domains/segments/segment_tools.py,sha256=AWAblQrJBhdyTenYwEbKxZ_x4RgjGFud4H7vJ42I9kE,8164
82
83
  kfinance/domains/segments/tests/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
83
- kfinance/domains/segments/tests/test_segment_tools.py,sha256=bz7CTKvIW2BbIbavXvXl2HuCIzh9MGaYu12q8w32KiY,3360
84
+ kfinance/domains/segments/tests/test_segment_tools.py,sha256=hUztgU__1y7bEVYgytg322gQoNHUdYeh7QOvq0yTgRM,8382
84
85
  kfinance/domains/statements/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
85
- kfinance/domains/statements/statement_models.py,sha256=f7jEejuvMbsW9paqHIJ19DKUX3XL_qzf74jZBKDamfE,328
86
- kfinance/domains/statements/statement_tools.py,sha256=OPLPLM8ZArPT5eSutZCR80wJ2zOCZQn-hBk8riAOrh0,4922
86
+ kfinance/domains/statements/statement_models.py,sha256=KEf44kT85F6e4haGjuRCWNia0orxKvEuyq8UDZEJa_c,691
87
+ kfinance/domains/statements/statement_tools.py,sha256=54LAdYC9qYhNVeVx0kjNFiJ3zQGM1-TuZxVFt4VPdyY,9725
87
88
  kfinance/domains/statements/tests/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
88
- kfinance/domains/statements/tests/test_statement_tools.py,sha256=E-wIgnCF1946odDPc2dOh1K5xXIA59kEPrkILPwXwsw,4003
89
+ kfinance/domains/statements/tests/test_statement_tools.py,sha256=bAk8ct-PklvUWyGUgbE78vEAsfPL5i4siSp8REW5VW4,13214
89
90
  kfinance/integrations/README.md,sha256=GalSN11UHzbLfcNzKAlObNbw5XqMKVXSVzzGlryM3zc,320
90
91
  kfinance/integrations/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
91
92
  kfinance/integrations/local_mcp/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
92
- kfinance/integrations/local_mcp/kfinance_mcp.py,sha256=UxnRq5f7PF-dVZrUyH2TpBxVdKb7RbLP64AuD1kcy-E,1099
93
+ kfinance/integrations/local_mcp/kfinance_mcp.py,sha256=PSESfJj3rU1Y1nLHJp9j2JzHbNz-_qYf88F_st5bA78,1099
93
94
  kfinance/integrations/local_mcp/local_mcp.py,sha256=x2pCV7kFaEJZCHTlbudrByYb8RQX2gjGTD5UPzvhdmA,3778
94
95
  kfinance/integrations/tests/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
95
- kfinance/integrations/tests/test_example_notebook.py,sha256=NrqYFn_XyOn0YlV9QYEnNMBB7LEkg70pP1eqiLGxcBE,6529
96
+ kfinance/integrations/tests/test_example_notebook.py,sha256=kdileeEjQHnMpID-W58NHyt74AJ3Gi0ALkSGLUNAv98,7921
96
97
  kfinance/integrations/tool_calling/README.md,sha256=TSk-AJddoEctzc0HXQvGNac2CckbnWxHcRDtEifSe1w,2029
97
98
  kfinance/integrations/tool_calling/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
98
- kfinance/integrations/tool_calling/all_tools.py,sha256=UsmCupFumXx2J5AZU9M0fbihbZhlirzVrOQehpcgbfo,2724
99
+ kfinance/integrations/tool_calling/all_tools.py,sha256=EB8Yvz5C3ogcFrHNuY8j5x5G6apvTi6IseQk59zQdkU,2811
99
100
  kfinance/integrations/tool_calling/prompts.py,sha256=4qeW_VLLcxutUFuXnMKa0QD-_jq9qufo03BY-Slz-XU,1718
100
- kfinance/integrations/tool_calling/tool_calling_models.py,sha256=o1LGGwx8ikwEiZaHEALS4rvymF9O1Mp5dO9LcfFheUI,5856
101
+ kfinance/integrations/tool_calling/tool_calling_models.py,sha256=v_96LNAdT4maoGA6OEU26ogbqMXBR3yeS-gRW_sf9p8,6186
101
102
  kfinance/integrations/tool_calling/static_tools/README.md,sha256=lWQWdLY1tkGxqE8o4f61gc-RCX0doaCnZM0GmcNO6Jo,97
102
103
  kfinance/integrations/tool_calling/static_tools/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
103
104
  kfinance/integrations/tool_calling/static_tools/get_latest.py,sha256=pSLjofq9E6cQqGSFC73KmVpLATk9t5e-dUChsRmYUIQ,883
104
- kfinance/integrations/tool_calling/static_tools/get_n_quarters_ago.py,sha256=e29Mln2ExFZQwXLQmIrIk6eZToPI_IcfEMiVInR-NLU,810
105
+ kfinance/integrations/tool_calling/static_tools/get_n_quarters_ago.py,sha256=Psa_qhjjJ-qHOhqFh1qR3iZTfkvXf--iHpILbAFPtG8,881
105
106
  kfinance/integrations/tool_calling/static_tools/tests/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
106
- kfinance/integrations/tool_calling/static_tools/tests/test_get_lastest.py,sha256=26CpdDcb-Ai3w-6qPVRRFPdlT2EKAFuOWkIRhxvb_Fk,989
107
- kfinance/integrations/tool_calling/static_tools/tests/test_get_n_quarters_ago.py,sha256=r7wtp7ttcJkKi2DQd42nzjfSXcpZAL97SrbltnjHuEI,775
107
+ kfinance/integrations/tool_calling/static_tools/tests/test_get_lastest.py,sha256=MN2gx-Hhvfvwh9v6eL_d5Yrbb054q7How1tPdYQlPvg,1149
108
+ kfinance/integrations/tool_calling/static_tools/tests/test_get_n_quarters_ago.py,sha256=BjlTgaNrI5Tv7SpTWz0Q8WucDLcQviCqVH2zgLpNpcM,856
108
109
  kfinance/integrations/tool_calling/tests/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
109
- kfinance/integrations/tool_calling/tests/test_tool_calling_models.py,sha256=Ts1pvaYjq9BTR71dMZ73X__bQ7gQynPkQjy-9x2CuyQ,2605
110
+ kfinance/integrations/tool_calling/tests/test_tool_calling_models.py,sha256=5L8TpSVJmrjNzGcnERorpfeyrgLND_DL46ld5hVlcNw,2933
110
111
  kfinance/models/permission_models.py,sha256=G0so8ZOsD1YDsCM4he0z5R9M_shUbSRwD3hUDJdqZl0,635
111
- kensho_kfinance-3.2.4.dist-info/METADATA,sha256=rc_-W3DvkZ-X_MtcKpQUD3I5rcf4pPVZa9BIaBvjyUE,6197
112
- kensho_kfinance-3.2.4.dist-info/WHEEL,sha256=_zCd3N1l69ArxyTb8rzEoP9TpbYXkqRFSNOD5OuxnTs,91
113
- kensho_kfinance-3.2.4.dist-info/top_level.txt,sha256=kT_kNwVhfQoOAecY8W7uYah5xaHMoHoAdBIvXh6DaKM,9
114
- kensho_kfinance-3.2.4.dist-info/RECORD,,
112
+ kensho_kfinance-4.0.0.dist-info/METADATA,sha256=TrVpQ5qd3ll2BLyiMZQhlRV10MzoCeWdxpnCWErtq2A,6203
113
+ kensho_kfinance-4.0.0.dist-info/WHEEL,sha256=_zCd3N1l69ArxyTb8rzEoP9TpbYXkqRFSNOD5OuxnTs,91
114
+ kensho_kfinance-4.0.0.dist-info/top_level.txt,sha256=kT_kNwVhfQoOAecY8W7uYah5xaHMoHoAdBIvXh6DaKM,9
115
+ kensho_kfinance-4.0.0.dist-info/RECORD,,
kfinance/CHANGELOG.md CHANGED
@@ -1,5 +1,56 @@
1
1
  # Changelog
2
2
 
3
+ ## v4.0.0
4
+ - Update line items, statements, and segments models for fiscal period lookup
5
+
6
+ ## v3.2.20
7
+ - Relax fastmcp version constraint
8
+
9
+ ## v3.2.19
10
+ - Updated tool descriptions to be more descriptive and include examples
11
+
12
+ ## v3.2.18
13
+ - Add info on how to fetch transcripts to earnings call tools
14
+
15
+ ## v3.2.17
16
+ - Shorten `get_advisors_for_company_in_transaction_from_identifier` tool name.
17
+
18
+ ## v3.2.16
19
+ - Allow None and "NaN" for DecimalWithValue
20
+
21
+ ## v3.2.15
22
+ - Add smart line item validation with intelligent suggestions and descriptions to reduce token consumption by 75%
23
+
24
+ ## 3.2.14
25
+ - Fix Capitalizations validator to handle nulls
26
+
27
+ ## 3.2.13
28
+ - Fix Prices validator to handle null OHLC price data
29
+
30
+ ## 3.2.12
31
+ - Remove multiples line item support
32
+
33
+ ## 3.2.11
34
+ - Add Handling of status code 400 for Capitalizations, Modify EV/TEV ratio to target quarterly or LTM
35
+
36
+ ## 3.2.10
37
+ - Add CIQ company_id to GetInfoFromIdentifiersResp
38
+
39
+ ## v3.2.9
40
+ - Update tool descriptions for line items, segments, and statements to mention that all period-based inputs and outputs refer only to the calendar year.
41
+
42
+ ## v3.2.8
43
+ - Add support for None to LineItemResponse & empty behavior for line items, segments, and statements
44
+
45
+ ## v3.2.7
46
+ - Fix validator for UnifiedIdTripleResponse
47
+
48
+ ## v3.2.6
49
+ - Return pydantic models from KfinanceTool._run
50
+
51
+ ## v3.2.5
52
+ - Add requested EV ratio line items
53
+
3
54
  ## v3.2.4
4
55
  - Add Mergers & Acquisitions tools to ALL_TOOLS
5
56
 
@@ -158,7 +158,9 @@ def resolve_future_with_error_handling(future: Future) -> Any:
158
158
  return future.result()
159
159
  except HTTPError as http_err:
160
160
  error_code = http_err.response.status_code
161
- if error_code == 404:
161
+ if error_code == 400:
162
+ return None
163
+ elif error_code == 404:
162
164
  return None
163
165
  else:
164
166
  raise http_err
kfinance/client/fetch.py CHANGED
@@ -11,6 +11,7 @@ import requests
11
11
 
12
12
  from kfinance.client.industry_models import IndustryClassification
13
13
  from kfinance.client.models.date_and_period_models import Periodicity, PeriodType
14
+ from kfinance.client.models.response_models import PostResponse
14
15
  from kfinance.client.permission_models import Permission
15
16
  from kfinance.domains.business_relationships.business_relationship_models import (
16
17
  BusinessRelationshipType,
@@ -25,8 +26,11 @@ from kfinance.domains.companies.company_models import (
25
26
  )
26
27
  from kfinance.domains.competitors.competitor_models import CompetitorResponse, CompetitorSource
27
28
  from kfinance.domains.earnings.earning_models import EarningsCallResp
28
- from kfinance.domains.line_items.line_item_models import LineItemResponse
29
- from kfinance.domains.mergers_and_acquisitions.merger_and_acquisition_models import MergersResp
29
+ from kfinance.domains.line_items.line_item_models import CalendarType, LineItemResp
30
+ from kfinance.domains.mergers_and_acquisitions.merger_and_acquisition_models import (
31
+ MergerInfo,
32
+ MergersResp,
33
+ )
30
34
  from kfinance.domains.prices.price_models import HistoryMetadataResp, PriceHistory
31
35
  from kfinance.domains.segments.segment_models import SegmentsResp, SegmentType
32
36
  from kfinance.domains.statements.statement_models import StatementsResp
@@ -349,24 +353,48 @@ class KFinanceApiClient:
349
353
 
350
354
  def fetch_segments(
351
355
  self,
352
- company_id: int,
356
+ company_ids: list[int],
353
357
  segment_type: SegmentType,
354
- period_type: Optional[PeriodType] = None,
355
- start_year: Optional[int] = None,
356
- end_year: Optional[int] = None,
357
- start_quarter: Optional[int] = None,
358
- end_quarter: Optional[int] = None,
359
- ) -> SegmentsResp:
358
+ *,
359
+ start_year: int | None = None,
360
+ end_year: int | None = None,
361
+ start_quarter: int | None = None,
362
+ end_quarter: int | None = None,
363
+ num_periods_back: int | None = None,
364
+ num_periods: int | None = None,
365
+ period_type: PeriodType | None = None,
366
+ calendar_type: CalendarType | None = None,
367
+ ) -> PostResponse[SegmentsResp]:
360
368
  """Get a specified segment type for a specified duration."""
361
- url = (
362
- f"{self.url_base}segments/{company_id}/{segment_type}/"
363
- f"{period_type if period_type else 'none'}/"
364
- f"{start_year if start_year is not None else 'none'}/"
365
- f"{end_year if end_year is not None else 'none'}/"
366
- f"{start_quarter if start_quarter is not None else 'none'}/"
367
- f"{end_quarter if end_quarter is not None else 'none'}"
368
- )
369
- return SegmentsResp.model_validate(self.fetch(url))
369
+
370
+ url = f"{self.url_base}segments/"
371
+
372
+ period_type_val = period_type.value if period_type is not None else None
373
+ calendar_type_val = calendar_type.value if calendar_type is not None else None
374
+ segment_type_val = segment_type.value if segment_type is not None else None
375
+
376
+ request_body: dict[str, str | int | list[int]] = {
377
+ "company_ids": company_ids,
378
+ "segment_type": segment_type_val,
379
+ }
380
+
381
+ fields = [
382
+ ("start_year", start_year),
383
+ ("end_year", end_year),
384
+ ("start_quarter", start_quarter),
385
+ ("end_quarter", end_quarter),
386
+ ("num_periods_back", num_periods_back),
387
+ ("num_periods", num_periods),
388
+ ("period_type", period_type_val),
389
+ ("calendar_type", calendar_type_val),
390
+ ]
391
+
392
+ for key, value in fields:
393
+ if value is not None:
394
+ request_body[key] = value
395
+
396
+ response_data = self.fetch(url, method="POST", request_body=request_body)
397
+ return PostResponse[SegmentsResp].model_validate(response_data)
370
398
 
371
399
  def fetch_price_chart(
372
400
  self,
@@ -398,45 +426,91 @@ class KFinanceApiClient:
398
426
 
399
427
  def fetch_statement(
400
428
  self,
401
- company_id: int,
429
+ company_ids: list[int],
402
430
  statement_type: str,
403
- period_type: Optional[PeriodType] = None,
404
- start_year: Optional[int] = None,
405
- end_year: Optional[int] = None,
406
- start_quarter: Optional[int] = None,
407
- end_quarter: Optional[int] = None,
408
- ) -> StatementsResp:
431
+ *,
432
+ start_year: int | None = None,
433
+ end_year: int | None = None,
434
+ start_quarter: int | None = None,
435
+ end_quarter: int | None = None,
436
+ num_periods_back: int | None = None,
437
+ num_periods: int | None = None,
438
+ period_type: PeriodType | None = None,
439
+ calendar_type: CalendarType | None = None,
440
+ ) -> PostResponse[StatementsResp]:
409
441
  """Get a specified financial statement for a specified duration."""
410
- url = (
411
- f"{self.url_base}statements/{company_id}/{statement_type}/"
412
- f"{period_type if period_type else 'none'}/"
413
- f"{start_year if start_year is not None else 'none'}/"
414
- f"{end_year if end_year is not None else 'none'}/"
415
- f"{start_quarter if start_quarter is not None else 'none'}/"
416
- f"{end_quarter if end_quarter is not None else 'none'}"
417
- )
418
- return StatementsResp.model_validate(self.fetch(url))
442
+
443
+ url = f"{self.url_base}statements/"
444
+
445
+ period_type_val = period_type.value if period_type is not None else None
446
+ calendar_type_val = calendar_type.value if calendar_type is not None else None
447
+
448
+ request_body: dict[str, str | int | list[int]] = {
449
+ "company_ids": company_ids,
450
+ "statement_type": statement_type,
451
+ }
452
+
453
+ fields = [
454
+ ("start_year", start_year),
455
+ ("end_year", end_year),
456
+ ("start_quarter", start_quarter),
457
+ ("end_quarter", end_quarter),
458
+ ("num_periods_back", num_periods_back),
459
+ ("num_periods", num_periods),
460
+ ("period_type", period_type_val),
461
+ ("calendar_type", calendar_type_val),
462
+ ]
463
+
464
+ for key, value in fields:
465
+ if value is not None:
466
+ request_body[key] = value
467
+
468
+ response_data = self.fetch(url, method="POST", request_body=request_body)
469
+ return PostResponse[StatementsResp].model_validate(response_data)
419
470
 
420
471
  def fetch_line_item(
421
472
  self,
422
- company_id: int,
473
+ company_ids: list[int],
423
474
  line_item: str,
424
- period_type: Optional[PeriodType] = None,
425
- start_year: Optional[int] = None,
426
- end_year: Optional[int] = None,
427
- start_quarter: Optional[int] = None,
428
- end_quarter: Optional[int] = None,
429
- ) -> LineItemResponse:
475
+ *,
476
+ start_year: int | None = None,
477
+ end_year: int | None = None,
478
+ start_quarter: int | None = None,
479
+ end_quarter: int | None = None,
480
+ num_periods_back: int | None = None,
481
+ num_periods: int | None = None,
482
+ period_type: PeriodType | None = None,
483
+ calendar_type: CalendarType | None = None,
484
+ ) -> PostResponse[LineItemResp]:
430
485
  """Get a specified financial line item for a specified duration."""
431
- url = (
432
- f"{self.url_base}line_item/{company_id}/{line_item}/"
433
- f"{period_type if period_type else 'none'}/"
434
- f"{start_year if start_year is not None else 'none'}/"
435
- f"{end_year if end_year is not None else 'none'}/"
436
- f"{start_quarter if start_quarter is not None else 'none'}/"
437
- f"{end_quarter if end_quarter is not None else 'none'}"
438
- )
439
- return LineItemResponse.model_validate(self.fetch(url))
486
+
487
+ url = f"{self.url_base}line_item/"
488
+
489
+ period_type_val = period_type.value if period_type is not None else None
490
+ calendar_type_val = calendar_type.value if calendar_type is not None else None
491
+
492
+ request_body: dict[str, str | int | list[int]] = {
493
+ "company_ids": company_ids,
494
+ "line_item": line_item,
495
+ }
496
+
497
+ fields = [
498
+ ("start_year", start_year),
499
+ ("end_year", end_year),
500
+ ("start_quarter", start_quarter),
501
+ ("end_quarter", end_quarter),
502
+ ("num_periods_back", num_periods_back),
503
+ ("num_periods", num_periods),
504
+ ("period_type", period_type_val),
505
+ ("calendar_type", calendar_type_val),
506
+ ]
507
+
508
+ for key, value in fields:
509
+ if value is not None:
510
+ request_body[key] = value
511
+
512
+ response_data = self.fetch(url, method="POST", request_body=request_body)
513
+ return PostResponse[LineItemResp].model_validate(response_data)
440
514
 
441
515
  def fetch_info(self, company_id: int) -> dict:
442
516
  """Get the company info."""
@@ -645,17 +719,16 @@ class KFinanceApiClient:
645
719
  def fetch_merger_info(
646
720
  self,
647
721
  transaction_id: int,
648
- ) -> dict:
722
+ ) -> MergerInfo:
649
723
  """Fetches information about the given merger or acquisition, including the timeline, the participants, and the considerations.
650
724
 
651
- Returns a complex dictionary.
652
725
  :param transaction_id: The transaction ID to filter on.
653
726
  :type transaction_id: int
654
727
  :return: A dictionary containing the timeline, the participants, and the considerations (eith their details) of the transaction.
655
- :rtype: dict
728
+ :rtype: MergerInfo
656
729
  """
657
730
  url = f"{self.url_base}merger/info/{transaction_id}"
658
- return self.fetch(url)
731
+ return MergerInfo.model_validate(self.fetch(url))
659
732
 
660
733
  def fetch_advisors_for_company_in_merger(
661
734
  self,