kensho-kfinance 3.2.5__py3-none-any.whl → 3.2.7__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 (43) hide show
  1. {kensho_kfinance-3.2.5.dist-info → kensho_kfinance-3.2.7.dist-info}/METADATA +1 -1
  2. {kensho_kfinance-3.2.5.dist-info → kensho_kfinance-3.2.7.dist-info}/RECORD +43 -43
  3. kfinance/CHANGELOG.md +6 -0
  4. kfinance/client/fetch.py +7 -5
  5. kfinance/client/kfinance.py +38 -39
  6. kfinance/client/models/date_and_period_models.py +8 -7
  7. kfinance/client/tests/test_fetch.py +3 -1
  8. kfinance/client/tests/test_objects.py +38 -95
  9. kfinance/domains/business_relationships/business_relationship_tools.py +4 -4
  10. kfinance/domains/business_relationships/tests/test_business_relationship_tools.py +18 -16
  11. kfinance/domains/capitalizations/capitalization_models.py +3 -3
  12. kfinance/domains/capitalizations/capitalization_tools.py +7 -5
  13. kfinance/domains/capitalizations/tests/test_capitalization_tools.py +46 -36
  14. kfinance/domains/companies/company_models.py +8 -2
  15. kfinance/domains/companies/company_tools.py +8 -12
  16. kfinance/domains/companies/tests/test_company_tools.py +21 -9
  17. kfinance/domains/competitors/competitor_tools.py +2 -3
  18. kfinance/domains/competitors/tests/test_competitor_tools.py +22 -19
  19. kfinance/domains/cusip_and_isin/cusip_and_isin_tools.py +4 -6
  20. kfinance/domains/cusip_and_isin/tests/test_cusip_and_isin_tools.py +13 -8
  21. kfinance/domains/earnings/earning_tools.py +12 -9
  22. kfinance/domains/earnings/tests/test_earnings_tools.py +52 -43
  23. kfinance/domains/line_items/line_item_tools.py +2 -3
  24. kfinance/domains/line_items/tests/test_line_item_tools.py +20 -23
  25. kfinance/domains/mergers_and_acquisitions/merger_and_acquisition_models.py +46 -2
  26. kfinance/domains/mergers_and_acquisitions/merger_and_acquisition_tools.py +13 -68
  27. kfinance/domains/mergers_and_acquisitions/tests/test_merger_and_acquisition_tools.py +61 -59
  28. kfinance/domains/prices/price_tools.py +4 -7
  29. kfinance/domains/prices/tests/test_price_tools.py +47 -39
  30. kfinance/domains/segments/segment_tools.py +2 -3
  31. kfinance/domains/segments/tests/test_segment_tools.py +16 -11
  32. kfinance/domains/statements/statement_tools.py +2 -3
  33. kfinance/domains/statements/tests/test_statement_tools.py +40 -35
  34. kfinance/integrations/tool_calling/static_tools/get_n_quarters_ago.py +5 -0
  35. kfinance/integrations/tool_calling/static_tools/tests/test_get_lastest.py +13 -10
  36. kfinance/integrations/tool_calling/static_tools/tests/test_get_n_quarters_ago.py +2 -1
  37. kfinance/integrations/tool_calling/tests/test_tool_calling_models.py +8 -2
  38. kfinance/integrations/tool_calling/tool_calling_models.py +11 -5
  39. kfinance/version.py +2 -2
  40. {kensho_kfinance-3.2.5.dist-info → kensho_kfinance-3.2.7.dist-info}/WHEEL +0 -0
  41. {kensho_kfinance-3.2.5.dist-info → kensho_kfinance-3.2.7.dist-info}/licenses/AUTHORS.md +0 -0
  42. {kensho_kfinance-3.2.5.dist-info → kensho_kfinance-3.2.7.dist-info}/licenses/LICENSE +0 -0
  43. {kensho_kfinance-3.2.5.dist-info → kensho_kfinance-3.2.7.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.5
3
+ Version: 3.2.7
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,91 +1,91 @@
1
- kensho_kfinance-3.2.5.dist-info/licenses/AUTHORS.md,sha256=0h9ClbI0pu1oKj1M28ROUsaxrbZg-6ukQGl6X4y9noI,68
2
- kensho_kfinance-3.2.5.dist-info/licenses/LICENSE,sha256=bsY4blvSgq6o0FMQ3RXa2NCgco--nHCCchLXzxr6kms,83
3
- kfinance/CHANGELOG.md,sha256=rckpGI3Q0rTbFzFgTtXEE-oixFaQKFHBXEFrexNG3GU,2942
1
+ kensho_kfinance-3.2.7.dist-info/licenses/AUTHORS.md,sha256=0h9ClbI0pu1oKj1M28ROUsaxrbZg-6ukQGl6X4y9noI,68
2
+ kensho_kfinance-3.2.7.dist-info/licenses/LICENSE,sha256=bsY4blvSgq6o0FMQ3RXa2NCgco--nHCCchLXzxr6kms,83
3
+ kfinance/CHANGELOG.md,sha256=UddmW-btMQ2H8aUNxY3gIHVd_Lmr5toYlD-r0L5A-PQ,3054
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=dKerFuG9D27NeRGzxcRJXEJqthq8REJIAx8aiSuJ5DY,704
8
+ kfinance/version.py,sha256=ADz4iV30MoA4-uH6aIZn2XG9xptnnO-_t_Do6H2M4s0,704
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
12
- kfinance/client/fetch.py,sha256=JKw09G8P9jMw6qwVY4E-SAOW1YhZqVzOkirh0Nu8g9o,29336
12
+ kfinance/client/fetch.py,sha256=CDZA8VMsu-olwmribThQ7MMOy2cgwWqQOYZ7xH3G9jI,29362
13
13
  kfinance/client/industry_models.py,sha256=ydB_cTIsNsfCUeaO7K2qqLUuHdG6WfUCoAzBigKVV8M,243
14
- kfinance/client/kfinance.py,sha256=9BMhXfmw5WzNl-xFdLvkvgJIr585F5rlM7YePwtlW7s,72684
14
+ kfinance/client/kfinance.py,sha256=-tyw9-pcP9gag20OTaOO8HpwQRae3iOuFqQ3PqzWagQ,72290
15
15
  kfinance/client/meta_classes.py,sha256=O0qoz1ALveS25GgOVOfMjjsw0gl9gojpiLCfF-a8xsY,23622
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
20
+ kfinance/client/models/date_and_period_models.py,sha256=KalZYTcDMkJiGBdaacpTwnaFSyDNgwku__rqdVtbs5Y,1091
21
21
  kfinance/client/models/decimal_with_unit.py,sha256=lfBvOQDk1cdWnqRh7oZoXe3_TbjNsbaV31KyosH_OoY,2911
22
22
  kfinance/client/models/tests/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
23
23
  kfinance/client/models/tests/test_decimal_with_unit.py,sha256=7WlmVXFOFNHFqwsvXQvcgyPfa6noRm3-mLTcXz4GvRs,2202
24
24
  kfinance/client/tests/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
25
25
  kfinance/client/tests/test_batch_requests.py,sha256=KcE5rNJHBP27xaZOmwg8cVyUMZAAPt6jDiCeq94wUUk,11661
26
26
  kfinance/client/tests/test_client.py,sha256=GlK89ZOGL9bwrAUFUk8nua2ooKt0JYm7o_rpAfajFXA,4312
27
- kfinance/client/tests/test_fetch.py,sha256=nFVQ3hHn7gqe7ecTYRviRxLuf06QyFZegfDLLOSUpR8,21569
27
+ kfinance/client/tests/test_fetch.py,sha256=QbrvHSpB4DVpx5qAo175Mhr31U0I8riAqT8fS3GGyTA,21715
28
28
  kfinance/client/tests/test_group_objects.py,sha256=wb7MEyGm-Qya3CXWM5Xz3kUhKFWdHT8FF3cQcjt1WxQ,1696
29
- kfinance/client/tests/test_objects.py,sha256=eAEy1kAHS6JQDoXVU5uSyTQpV099F3xFZsbvgspWMn8,42623
29
+ kfinance/client/tests/test_objects.py,sha256=6BGw-rQle43aQckIvnsfIF5YOS4_nE8b7E9Ee1lP4dM,39834
30
30
  kfinance/domains/README.md,sha256=ehD15VwLupdXbz5M7hHUI7Y-2SCGxaP5W7Q4NuMcN64,664
31
31
  kfinance/domains/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
32
32
  kfinance/domains/business_relationships/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
33
33
  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
34
+ kfinance/domains/business_relationships/business_relationship_tools.py,sha256=xKuS0sm0ijX3wQJTu1nv3M_7AJ7XMbO0neVI2VjqKIE,3328
35
35
  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
36
+ kfinance/domains/business_relationships/tests/test_business_relationship_tools.py,sha256=e_EGtM4i5Qw5J1Wi2kXahkyjDA4mhHcT0DFAKA5JQdI,2459
37
37
  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
38
+ kfinance/domains/capitalizations/capitalization_models.py,sha256=SsNsL4NoK4csyOja0Bw1Nw-JcpqaMw1UDeM4sKxVQ7Y,3382
39
+ kfinance/domains/capitalizations/capitalization_tools.py,sha256=FJBxotSX-1a7GEKSEkSIuXXIgNyjSnac336rQBePU80,4753
40
40
  kfinance/domains/capitalizations/tests/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
41
41
  kfinance/domains/capitalizations/tests/test_capitalization_models.py,sha256=SSFxEVnSLvuNjOK-gx4I3OCHso80OA37zOLmiHJhsro,3143
42
- kfinance/domains/capitalizations/tests/test_capitalization_tools.py,sha256=LDjFiEEax2O65HQ65CY73J3y4RvuKjw5pqBO5imoUyY,4187
42
+ kfinance/domains/capitalizations/tests/test_capitalization_tools.py,sha256=H43mlYDq6GCQOw3tm6pFmvZKuJ-WctaqVTRJyYizvY8,4588
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
- kfinance/domains/companies/company_models.py,sha256=ez87FsQlpYvAmd668sAgSbdgFum4PjMisN59J4vkqNo,4819
46
- kfinance/domains/companies/company_tools.py,sha256=wwhB98fg8mKOJp1kvN-KKFhKurLx6F6KX3BfLPJkWP0,8984
45
+ kfinance/domains/companies/company_models.py,sha256=Ny0o5lB5e1gN3bSj8bVbfqg6ktgJrwn9-58sKO1bmXs,5060
46
+ kfinance/domains/companies/company_tools.py,sha256=Vuyegx0fTM8snOj2Ywou2cgy8puxh1Ry2zTbT5i9ltk,8885
47
47
  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
48
+ kfinance/domains/companies/tests/test_company_tools.py,sha256=6Gl3Sjg80Qri-TrP1UB8RgmgQ8LOAhVZ1nxevAZJAc4,5377
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
- kfinance/domains/competitors/competitor_tools.py,sha256=W_vRMng5UG1csJWDZKDxibrvXzUcwwnN9hw5cSg4EHI,2551
51
+ kfinance/domains/competitors/competitor_tools.py,sha256=k1zyr03gbnIrQ8IaENaZlVE8RiiW_77MqnArWzKa02M,2524
52
52
  kfinance/domains/competitors/tests/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
53
- kfinance/domains/competitors/tests/test_competitor_tools.py,sha256=GL03SBGU2XKejh6Y1F1wwtvNLmoOLGxuysLAHO0khRU,2377
53
+ kfinance/domains/competitors/tests/test_competitor_tools.py,sha256=o7y4huxc5DUTNBm5HO-QArr-X9wEcXtsX5umuQ3owz4,2552
54
54
  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
55
+ kfinance/domains/cusip_and_isin/cusip_and_isin_tools.py,sha256=Ib1ajSf1M062pdXAroyv9zm5tx5Y73X0cNK6QOZYUNs,3405
56
56
  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
57
+ kfinance/domains/cusip_and_isin/tests/test_cusip_and_isin_tools.py,sha256=lnFOkMLvbszSMwTHNaJyxsjLgAPwsYczrhyPjCDdoVQ,2459
58
58
  kfinance/domains/earnings/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
59
59
  kfinance/domains/earnings/earning_models.py,sha256=3iPnjx3n511wqwSVB9_FMJ1ceCgIURnKpc3hwr9fIjY,1197
60
- kfinance/domains/earnings/earning_tools.py,sha256=2yhb8PK56bXHQZ3EGL9-645t56FgMTLbVooFklBD8OE,6900
60
+ kfinance/domains/earnings/earning_tools.py,sha256=AmHZQKTGExPPxyDdjhrn5CVLvWr6xMLfkOr4FUavLlU,7020
61
61
  kfinance/domains/earnings/tests/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
62
- kfinance/domains/earnings/tests/test_earnings_tools.py,sha256=HmCaDW5a7gKWu2tKRrgjCX0xYk6FdoQBbNfGp2lwaiI,6462
62
+ kfinance/domains/earnings/tests/test_earnings_tools.py,sha256=qGhdWI1s4uEjF6XtFC0f1nlAths1H6xfym-iJyBpwBo,6998
63
63
  kfinance/domains/line_items/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
64
64
  kfinance/domains/line_items/line_item_models.py,sha256=qDvY2dVGNP9JlujuHYefoi3Q9Yg0ICyEi4HsHx5Cneg,50962
65
- kfinance/domains/line_items/line_item_tools.py,sha256=C-E7W1cNSYRtqXp1ULAaXcxMh64alcEwhOMAarNo6uk,4954
65
+ kfinance/domains/line_items/line_item_tools.py,sha256=fLLEGND7S8MLd-0sGKgWUxb3JZP4Rdq4b4azjzlTrZo,4929
66
66
  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
67
+ kfinance/domains/line_items/tests/test_line_item_tools.py,sha256=Bxsf0cGTxbc3dZ6djbC53pA3l0kzogA942LJFNfkuYQ,4082
68
68
  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
69
+ kfinance/domains/mergers_and_acquisitions/merger_and_acquisition_models.py,sha256=WAWyBCgYMZj8NLz6nq_sW5MRg_UU5_F9jUUoQ_bcmsM,1893
70
+ kfinance/domains/mergers_and_acquisitions/merger_and_acquisition_tools.py,sha256=Yx3_TxTWdPcIiOddyAJEddpWc6L-fgx1-JoMtqdPtWQ,7156
71
71
  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
72
+ kfinance/domains/mergers_and_acquisitions/tests/test_merger_and_acquisition_tools.py,sha256=uN9LewN_k4yy5IPR0lbeyYxi8UF2mmebOF3gvXCSt6M,6383
73
73
  kfinance/domains/prices/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
74
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_tools.py,sha256=gR83pFB0MymiyKczV8WBz6YHSbKJE5yd1_2Y2winJd8,7128
76
76
  kfinance/domains/prices/tests/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
77
77
  kfinance/domains/prices/tests/test_price_models.py,sha256=PWGqbR9aCys2ldHZMF5anMXsSYEVOjgygfpxLcLVKL8,2400
78
- kfinance/domains/prices/tests/test_price_tools.py,sha256=2jCx79TyqZ7naKQrHm421vDX3zBgj-0kaas1TX5LpfA,5995
78
+ kfinance/domains/prices/tests/test_price_tools.py,sha256=xNuzAzeu1KuhkB0xF2oIYLVZub9uDg8VLRNmKq-iJ3s,6426
79
79
  kfinance/domains/segments/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
80
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_tools.py,sha256=DhbTnH6JwRbkJsUqR3bMtzlSNggg9wATRXFo8x4XXho,4330
82
82
  kfinance/domains/segments/tests/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
83
- kfinance/domains/segments/tests/test_segment_tools.py,sha256=bz7CTKvIW2BbIbavXvXl2HuCIzh9MGaYu12q8w32KiY,3360
83
+ kfinance/domains/segments/tests/test_segment_tools.py,sha256=aOesRHFjR9FG0urmiPCzxYXDNjnrw8sqKovuEnDPHC8,3574
84
84
  kfinance/domains/statements/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
85
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_tools.py,sha256=8zJZtPktbszVuwKifPhY0_k3nsJALyR2SjZoqgEp5gE,4898
87
87
  kfinance/domains/statements/tests/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
88
- kfinance/domains/statements/tests/test_statement_tools.py,sha256=E-wIgnCF1946odDPc2dOh1K5xXIA59kEPrkILPwXwsw,4003
88
+ kfinance/domains/statements/tests/test_statement_tools.py,sha256=ruojqNUnnBYynJpjl6Oj62c-K2eXV4Gh0whvcgRw3N0,4355
89
89
  kfinance/integrations/README.md,sha256=GalSN11UHzbLfcNzKAlObNbw5XqMKVXSVzzGlryM3zc,320
90
90
  kfinance/integrations/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
91
91
  kfinance/integrations/local_mcp/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
@@ -97,18 +97,18 @@ kfinance/integrations/tool_calling/README.md,sha256=TSk-AJddoEctzc0HXQvGNac2Cckb
97
97
  kfinance/integrations/tool_calling/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
98
98
  kfinance/integrations/tool_calling/all_tools.py,sha256=UsmCupFumXx2J5AZU9M0fbihbZhlirzVrOQehpcgbfo,2724
99
99
  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
100
+ kfinance/integrations/tool_calling/tool_calling_models.py,sha256=5F2OmCkm2fYb-F2kKZ-1-F-SxLoE_A9LelyDVOcL8xg,6161
101
101
  kfinance/integrations/tool_calling/static_tools/README.md,sha256=lWQWdLY1tkGxqE8o4f61gc-RCX0doaCnZM0GmcNO6Jo,97
102
102
  kfinance/integrations/tool_calling/static_tools/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
103
103
  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
104
+ kfinance/integrations/tool_calling/static_tools/get_n_quarters_ago.py,sha256=Psa_qhjjJ-qHOhqFh1qR3iZTfkvXf--iHpILbAFPtG8,881
105
105
  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
106
+ kfinance/integrations/tool_calling/static_tools/tests/test_get_lastest.py,sha256=MN2gx-Hhvfvwh9v6eL_d5Yrbb054q7How1tPdYQlPvg,1149
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=Ts1pvaYjq9BTR71dMZ73X__bQ7gQynPkQjy-9x2CuyQ,2605
109
+ kfinance/integrations/tool_calling/tests/test_tool_calling_models.py,sha256=FIusHU4kFmVPuh31Kn57_356tNNVMGTbHApMUFJOaGM,2724
110
110
  kfinance/models/permission_models.py,sha256=G0so8ZOsD1YDsCM4he0z5R9M_shUbSRwD3hUDJdqZl0,635
111
- kensho_kfinance-3.2.5.dist-info/METADATA,sha256=xlktpM_mDm05nGtb4nc8tYlROrkk-bvu05F4VnDA_bQ,6197
112
- kensho_kfinance-3.2.5.dist-info/WHEEL,sha256=_zCd3N1l69ArxyTb8rzEoP9TpbYXkqRFSNOD5OuxnTs,91
113
- kensho_kfinance-3.2.5.dist-info/top_level.txt,sha256=kT_kNwVhfQoOAecY8W7uYah5xaHMoHoAdBIvXh6DaKM,9
114
- kensho_kfinance-3.2.5.dist-info/RECORD,,
111
+ kensho_kfinance-3.2.7.dist-info/METADATA,sha256=_44qoF4hacG441wRJuZwFy-snXawFUdtnl4zsY1al7A,6197
112
+ kensho_kfinance-3.2.7.dist-info/WHEEL,sha256=_zCd3N1l69ArxyTb8rzEoP9TpbYXkqRFSNOD5OuxnTs,91
113
+ kensho_kfinance-3.2.7.dist-info/top_level.txt,sha256=kT_kNwVhfQoOAecY8W7uYah5xaHMoHoAdBIvXh6DaKM,9
114
+ kensho_kfinance-3.2.7.dist-info/RECORD,,
kfinance/CHANGELOG.md CHANGED
@@ -1,5 +1,11 @@
1
1
  # Changelog
2
2
 
3
+ # v3.2.7
4
+ - Fix validator for UnifiedIdTripleResponse
5
+
6
+ # v3.2.6
7
+ - Return pydantic models from KfinanceTool._run
8
+
3
9
  ## v3.2.5
4
10
  - Add requested EV ratio line items
5
11
 
kfinance/client/fetch.py CHANGED
@@ -26,7 +26,10 @@ from kfinance.domains.companies.company_models import (
26
26
  from kfinance.domains.competitors.competitor_models import CompetitorResponse, CompetitorSource
27
27
  from kfinance.domains.earnings.earning_models import EarningsCallResp
28
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.mergers_and_acquisitions.merger_and_acquisition_models import (
30
+ MergerInfo,
31
+ MergersResp,
32
+ )
30
33
  from kfinance.domains.prices.price_models import HistoryMetadataResp, PriceHistory
31
34
  from kfinance.domains.segments.segment_models import SegmentsResp, SegmentType
32
35
  from kfinance.domains.statements.statement_models import StatementsResp
@@ -645,17 +648,16 @@ class KFinanceApiClient:
645
648
  def fetch_merger_info(
646
649
  self,
647
650
  transaction_id: int,
648
- ) -> dict:
651
+ ) -> MergerInfo:
649
652
  """Fetches information about the given merger or acquisition, including the timeline, the participants, and the considerations.
650
653
 
651
- Returns a complex dictionary.
652
654
  :param transaction_id: The transaction ID to filter on.
653
655
  :type transaction_id: int
654
656
  :return: A dictionary containing the timeline, the participants, and the considerations (eith their details) of the transaction.
655
- :rtype: dict
657
+ :rtype: MergerInfo
656
658
  """
657
659
  url = f"{self.url_base}merger/info/{transaction_id}"
658
- return self.fetch(url)
660
+ return MergerInfo.model_validate(self.fetch(url))
659
661
 
660
662
  def fetch_advisors_for_company_in_merger(
661
663
  self,
@@ -31,13 +31,21 @@ from kfinance.client.meta_classes import (
31
31
  DelegatedCompanyFunctionsMetaClass,
32
32
  )
33
33
  from kfinance.client.models.date_and_period_models import (
34
+ CurrentPeriod,
35
+ LatestAnnualPeriod,
34
36
  LatestPeriods,
37
+ LatestQuarterlyPeriod,
35
38
  Periodicity,
36
39
  YearAndQuarter,
37
40
  )
38
41
  from kfinance.client.server_thread import ServerThread
39
42
  from kfinance.domains.companies.company_models import IdentificationTriple
40
43
  from kfinance.domains.earnings.earning_models import EarningsCall, TranscriptComponent
44
+ from kfinance.domains.mergers_and_acquisitions.merger_and_acquisition_models import (
45
+ MergerConsideration,
46
+ MergerInfo,
47
+ MergerTimelineElement,
48
+ )
41
49
  from kfinance.domains.prices.price_models import HistoryMetadataResp, PriceHistory
42
50
 
43
51
 
@@ -1266,24 +1274,13 @@ class MergerOrAcquisition:
1266
1274
  self.transaction_id = transaction_id
1267
1275
  self.merger_title = merger_title
1268
1276
  self.closed_date = closed_date
1269
- self._merger_info: dict | None = None
1277
+ self._merger_info: MergerInfo | None = None
1270
1278
 
1271
1279
  @property
1272
- def merger_info(self) -> dict:
1280
+ def merger_info(self) -> MergerInfo:
1273
1281
  """Property for the combined information in the merger."""
1274
1282
  if not self._merger_info:
1275
1283
  self._merger_info = self.kfinance_api_client.fetch_merger_info(self.transaction_id)
1276
- if "timeline" in self._merger_info and self._merger_info["timeline"]:
1277
- timeline = pd.DataFrame(self._merger_info["timeline"])
1278
- timeline["date"] = pd.to_datetime(timeline["date"])
1279
- self._merger_info["timeline"] = timeline
1280
- if (
1281
- "consideration" in self._merger_info
1282
- and self._merger_info["consideration"]
1283
- and "details" in self._merger_info["consideration"]
1284
- ):
1285
- details = pd.DataFrame(self._merger_info["consideration"]["details"])
1286
- self._merger_info["consideration"]["details"] = details
1287
1284
  return self._merger_info
1288
1285
 
1289
1286
  @property
@@ -1292,9 +1289,9 @@ class MergerOrAcquisition:
1292
1289
  return self.merger_title
1293
1290
 
1294
1291
  @property
1295
- def get_timeline(self) -> pd.DataFrame:
1292
+ def get_timeline(self) -> list[MergerTimelineElement]:
1296
1293
  """The timeline of the merger includes every new status, along with the dates of each status change."""
1297
- return self.merger_info["timeline"]
1294
+ return self.merger_info.timeline
1298
1295
 
1299
1296
  @property
1300
1297
  def get_participants(self) -> dict:
@@ -1308,8 +1305,8 @@ class MergerOrAcquisition:
1308
1305
  transaction_id=self.transaction_id,
1309
1306
  company=Company(
1310
1307
  kfinance_api_client=self.kfinance_api_client,
1311
- company_id=self.merger_info["participants"]["target"]["company_id"],
1312
- company_name=self.merger_info["participants"]["target"]["company_name"],
1308
+ company_id=self.merger_info.participants.target.company_id,
1309
+ company_name=self.merger_info.participants.target.company_name,
1313
1310
  ),
1314
1311
  ),
1315
1312
  "buyers": [
@@ -1318,11 +1315,11 @@ class MergerOrAcquisition:
1318
1315
  transaction_id=self.transaction_id,
1319
1316
  company=Company(
1320
1317
  kfinance_api_client=self.kfinance_api_client,
1321
- company_id=company["company_id"],
1322
- company_name=company["company_name"],
1318
+ company_id=company.company_id,
1319
+ company_name=company.company_name,
1323
1320
  ),
1324
1321
  )
1325
- for company in self.merger_info["participants"]["buyers"]
1322
+ for company in self.merger_info.participants.buyers
1326
1323
  ],
1327
1324
  "sellers": [
1328
1325
  ParticipantInMerger(
@@ -1330,16 +1327,16 @@ class MergerOrAcquisition:
1330
1327
  transaction_id=self.transaction_id,
1331
1328
  company=Company(
1332
1329
  kfinance_api_client=self.kfinance_api_client,
1333
- company_id=company["company_id"],
1334
- company_name=company["company_name"],
1330
+ company_id=company.company_id,
1331
+ company_name=company.company_name,
1335
1332
  ),
1336
1333
  )
1337
- for company in self.merger_info["participants"]["sellers"]
1334
+ for company in self.merger_info.participants.sellers
1338
1335
  ],
1339
1336
  }
1340
1337
 
1341
1338
  @property
1342
- def get_consideration(self) -> dict:
1339
+ def get_consideration(self) -> MergerConsideration:
1343
1340
  """A merger's consideration is the assets exchanged for the target company.
1344
1341
 
1345
1342
  Properties in the consideration include:
@@ -1354,7 +1351,7 @@ class MergerOrAcquisition:
1354
1351
  - The number of shares in the target company.
1355
1352
  - The current gross total of the consideration detail.
1356
1353
  """
1357
- return self.merger_info["consideration"]
1354
+ return self.merger_info.consideration
1358
1355
 
1359
1356
 
1360
1357
  @add_methods_of_singular_class_to_iterable_class(Company)
@@ -1903,16 +1900,18 @@ class Client:
1903
1900
  most_recent_year_annual = current_year - 1
1904
1901
 
1905
1902
  current_month = datetime_now.month
1906
- latest: LatestPeriods = {
1907
- "annual": {"latest_year": most_recent_year_annual},
1908
- "quarterly": {"latest_quarter": most_recent_qtr, "latest_year": most_recent_year_qtrly},
1909
- "now": {
1910
- "current_year": current_year,
1911
- "current_quarter": current_qtr,
1912
- "current_month": current_month,
1913
- "current_date": datetime_now.date().isoformat(),
1914
- },
1915
- }
1903
+ latest = LatestPeriods(
1904
+ annual=LatestAnnualPeriod(latest_year=most_recent_year_annual),
1905
+ quarterly=LatestQuarterlyPeriod(
1906
+ latest_quarter=most_recent_qtr, latest_year=most_recent_year_qtrly
1907
+ ),
1908
+ now=CurrentPeriod(
1909
+ current_year=current_year,
1910
+ current_quarter=current_qtr,
1911
+ current_month=current_month,
1912
+ current_date=datetime_now.date(),
1913
+ ),
1914
+ )
1916
1915
  return latest
1917
1916
 
1918
1917
  @staticmethod
@@ -1932,9 +1931,9 @@ class Client:
1932
1931
  year_n_quarters_ago = total_quarters_completed_n_quarters_ago // 4
1933
1932
  quarter_n_quarters_ago = total_quarters_completed_n_quarters_ago % 4 + 1
1934
1933
 
1935
- year_quarter_n_quarters_ago: YearAndQuarter = {
1936
- "year": year_n_quarters_ago,
1937
- "quarter": quarter_n_quarters_ago,
1938
- }
1934
+ year_quarter_n_quarters_ago = YearAndQuarter(
1935
+ year=year_n_quarters_ago,
1936
+ quarter=quarter_n_quarters_ago,
1937
+ )
1939
1938
 
1940
1939
  return year_quarter_n_quarters_ago
@@ -1,5 +1,6 @@
1
- from typing import TypedDict
1
+ from datetime import date
2
2
 
3
+ from pydantic import BaseModel
3
4
  from strenum import StrEnum
4
5
 
5
6
 
@@ -21,28 +22,28 @@ class Periodicity(StrEnum):
21
22
  year = "year"
22
23
 
23
24
 
24
- class YearAndQuarter(TypedDict):
25
+ class YearAndQuarter(BaseModel):
25
26
  year: int
26
27
  quarter: int
27
28
 
28
29
 
29
- class LatestAnnualPeriod(TypedDict):
30
+ class LatestAnnualPeriod(BaseModel):
30
31
  latest_year: int
31
32
 
32
33
 
33
- class LatestQuarterlyPeriod(TypedDict):
34
+ class LatestQuarterlyPeriod(BaseModel):
34
35
  latest_quarter: int
35
36
  latest_year: int
36
37
 
37
38
 
38
- class CurrentPeriod(TypedDict):
39
+ class CurrentPeriod(BaseModel):
39
40
  current_year: int
40
41
  current_quarter: int
41
42
  current_month: int
42
- current_date: str
43
+ current_date: date
43
44
 
44
45
 
45
- class LatestPeriods(TypedDict):
46
+ class LatestPeriods(BaseModel):
46
47
  annual: LatestAnnualPeriod
47
48
  quarterly: LatestQuarterlyPeriod
48
49
  now: CurrentPeriod
@@ -311,7 +311,9 @@ class TestFetchItem(TestCase):
311
311
  def test_fetch_merger_info(self) -> None:
312
312
  transaction_id = 554979212
313
313
  expected_fetch_url = f"{self.kfinance_api_client.url_base}merger/info/{transaction_id}"
314
- self.kfinance_api_client.fetch_merger_info(transaction_id=transaction_id)
314
+ # Validation error is ok, we only care that the function was called with the correct url
315
+ with pytest.raises(ValidationError):
316
+ self.kfinance_api_client.fetch_merger_info(transaction_id=transaction_id)
315
317
  self.kfinance_api_client.fetch.assert_called_with(expected_fetch_url)
316
318
 
317
319
  def test_fetch_advisors_for_company_in_merger(self) -> None:
@@ -14,7 +14,6 @@ from kfinance.client.kfinance import (
14
14
  BusinessRelationships,
15
15
  Company,
16
16
  Earnings,
17
- MergerOrAcquisition,
18
17
  ParticipantInMerger,
19
18
  Security,
20
19
  Ticker,
@@ -29,7 +28,10 @@ from kfinance.domains.capitalizations.capitalization_models import Capitalizatio
29
28
  from kfinance.domains.companies.company_models import CompanyIdAndName, IdentificationTriple
30
29
  from kfinance.domains.earnings.earning_models import EarningsCallResp
31
30
  from kfinance.domains.line_items.line_item_models import LineItemResponse
32
- from kfinance.domains.mergers_and_acquisitions.merger_and_acquisition_models import MergersResp
31
+ from kfinance.domains.mergers_and_acquisitions.merger_and_acquisition_models import (
32
+ MergerInfo,
33
+ MergersResp,
34
+ )
33
35
  from kfinance.domains.prices.price_models import HistoryMetadataResp
34
36
  from kfinance.domains.segments.segment_models import SegmentsResp
35
37
  from kfinance.domains.statements.statement_models import StatementsResp
@@ -254,39 +256,41 @@ MOCK_ISIN_DB = {msft_isin: msft_id_triple.model_dump(mode="json")}
254
256
  MOCK_CUSIP_DB = {msft_cusip: msft_id_triple.model_dump(mode="json")}
255
257
 
256
258
  MOCK_MERGERS_DB = {
257
- msft_buys_mongo: {
258
- "timeline": [
259
- {"status": "Announced", "date": "2000-09-12"},
260
- {"status": "Closed", "date": "2000-09-12"},
261
- ],
262
- "participants": {
263
- "target": {"company_id": 31696, "company_name": "MongoMusic, Inc."},
264
- "buyers": [{"company_id": 21835, "company_name": "Microsoft Corporation"}],
265
- "sellers": [
266
- {"company_id": 18805, "company_name": "Angel Investors L.P."},
267
- {"company_id": 20087, "company_name": "Draper Richards, L.P."},
268
- {"company_id": 22103, "company_name": "BRV Partners, LLC"},
269
- {"company_id": 23745, "company_name": "Venture Frogs, LLC"},
270
- {"company_id": 105902, "company_name": "ARGUS Capital International Limited"},
271
- {"company_id": 880300, "company_name": "Sony Music Entertainment, Inc."},
272
- ],
273
- },
274
- "consideration": {
275
- "currency_name": "US Dollar",
276
- "current_calculated_gross_total_transaction_value": "51609375.000000",
277
- "current_calculated_implied_equity_value": "51609375.000000",
278
- "current_calculated_implied_enterprise_value": "51609375.000000",
279
- "details": [
280
- {
281
- "scenario": "Stock Lump Sum",
282
- "subtype": "Common Equity",
283
- "cash_or_cash_equivalent_per_target_share_unit": None,
284
- "number_of_target_shares_sought": "1000000.000000",
285
- "current_calculated_gross_value_of_consideration": "51609375.000000",
286
- }
259
+ msft_buys_mongo: MergerInfo.model_validate(
260
+ {
261
+ "timeline": [
262
+ {"status": "Announced", "date": "2000-09-12"},
263
+ {"status": "Closed", "date": "2000-09-12"},
287
264
  ],
288
- },
289
- }
265
+ "participants": {
266
+ "target": {"company_id": 31696, "company_name": "MongoMusic, Inc."},
267
+ "buyers": [{"company_id": 21835, "company_name": "Microsoft Corporation"}],
268
+ "sellers": [
269
+ {"company_id": 18805, "company_name": "Angel Investors L.P."},
270
+ {"company_id": 20087, "company_name": "Draper Richards, L.P."},
271
+ {"company_id": 22103, "company_name": "BRV Partners, LLC"},
272
+ {"company_id": 23745, "company_name": "Venture Frogs, LLC"},
273
+ {"company_id": 105902, "company_name": "ARGUS Capital International Limited"},
274
+ {"company_id": 880300, "company_name": "Sony Music Entertainment, Inc."},
275
+ ],
276
+ },
277
+ "consideration": {
278
+ "currency_name": "US Dollar",
279
+ "current_calculated_gross_total_transaction_value": "51609375.000000",
280
+ "current_calculated_implied_equity_value": "51609375.000000",
281
+ "current_calculated_implied_enterprise_value": "51609375.000000",
282
+ "details": [
283
+ {
284
+ "scenario": "Stock Lump Sum",
285
+ "subtype": "Common Equity",
286
+ "cash_or_cash_equivalent_per_target_share_unit": None,
287
+ "number_of_target_shares_sought": "1000000.000000",
288
+ "current_calculated_gross_value_of_consideration": "51609375.000000",
289
+ }
290
+ ],
291
+ },
292
+ }
293
+ )
290
294
  }
291
295
 
292
296
 
@@ -1012,64 +1016,3 @@ class TestCompanyEarnings(TestCase):
1012
1016
  """test company next_earnings property"""
1013
1017
  next_earnings = self.msft_company.next_earnings
1014
1018
  self.assertEqual(next_earnings.key_dev_id, 1916266380)
1015
-
1016
-
1017
- class TestMerger(TestCase):
1018
- def setUp(self):
1019
- self.kfinance_api_client = MockKFinanceApiClient()
1020
- self.merger = MergerOrAcquisition(
1021
- kfinance_api_client=self.kfinance_api_client,
1022
- transaction_id=int(msft_buys_mongo),
1023
- merger_title="Closed M/A of MongoMusic, Inc.",
1024
- closed_date=date(2021, 1, 1),
1025
- )
1026
-
1027
- def test_merger_info(self) -> None:
1028
- expected_merger_info = MOCK_MERGERS_DB[msft_buys_mongo]
1029
- merger_info = {
1030
- "timeline": [
1031
- {"status": timeline["status"], "date": timeline["date"].strftime("%Y-%m-%d")}
1032
- for timeline in self.merger.get_timeline.to_dict(orient="records")
1033
- ],
1034
- "participants": {
1035
- "target": {
1036
- "company_id": self.merger.get_participants["target"].company.company_id,
1037
- "company_name": self.merger.get_participants["target"].company.name,
1038
- },
1039
- "buyers": [
1040
- {"company_id": buyer.company.company_id, "company_name": buyer.company.name}
1041
- for buyer in self.merger.get_participants["buyers"]
1042
- ],
1043
- "sellers": [
1044
- {"company_id": seller.company.company_id, "company_name": seller.company.name}
1045
- for seller in self.merger.get_participants["sellers"]
1046
- ],
1047
- },
1048
- "consideration": {
1049
- "currency_name": self.merger.get_consideration["currency_name"],
1050
- "current_calculated_gross_total_transaction_value": self.merger.get_consideration[
1051
- "current_calculated_gross_total_transaction_value"
1052
- ],
1053
- "current_calculated_implied_equity_value": self.merger.get_consideration[
1054
- "current_calculated_implied_equity_value"
1055
- ],
1056
- "current_calculated_implied_enterprise_value": self.merger.get_consideration[
1057
- "current_calculated_implied_enterprise_value"
1058
- ],
1059
- "details": [
1060
- {
1061
- "scenario": detail["scenario"],
1062
- "subtype": detail["subtype"],
1063
- "cash_or_cash_equivalent_per_target_share_unit": detail[
1064
- "cash_or_cash_equivalent_per_target_share_unit"
1065
- ],
1066
- "number_of_target_shares_sought": detail["number_of_target_shares_sought"],
1067
- "current_calculated_gross_value_of_consideration": detail[
1068
- "current_calculated_gross_value_of_consideration"
1069
- ],
1070
- }
1071
- for detail in self.merger.get_consideration["details"].to_dict(orient="records")
1072
- ],
1073
- },
1074
- }
1075
- self.assertEqual(ordered(expected_merger_info), ordered(merger_info))
@@ -38,7 +38,9 @@ class GetBusinessRelationshipFromIdentifiers(KfinanceTool):
38
38
  args_schema: Type[BaseModel] = GetBusinessRelationshipFromIdentifiersArgs
39
39
  accepted_permissions: set[Permission] | None = {Permission.RelationshipPermission}
40
40
 
41
- def _run(self, identifiers: list[str], business_relationship: BusinessRelationshipType) -> dict:
41
+ def _run(
42
+ self, identifiers: list[str], business_relationship: BusinessRelationshipType
43
+ ) -> GetBusinessRelationshipFromIdentifiersResp:
42
44
  """Sample response:
43
45
 
44
46
  {
@@ -76,10 +78,8 @@ class GetBusinessRelationshipFromIdentifiers(KfinanceTool):
76
78
  api_client=api_client, tasks=tasks
77
79
  )
78
80
 
79
- output_model = GetBusinessRelationshipFromIdentifiersResp(
81
+ return GetBusinessRelationshipFromIdentifiersResp(
80
82
  business_relationship=business_relationship,
81
83
  results=relationship_responses,
82
84
  errors=list(id_triple_resp.errors.values()),
83
85
  )
84
-
85
- return output_model.model_dump(mode="json")