kensho-kfinance 3.0.2__py3-none-any.whl → 3.1.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.
Potentially problematic release.
This version of kensho-kfinance might be problematic. Click here for more details.
- {kensho_kfinance-3.0.2.dist-info → kensho_kfinance-3.1.0.dist-info}/METADATA +1 -1
- {kensho_kfinance-3.0.2.dist-info → kensho_kfinance-3.1.0.dist-info}/RECORD +46 -45
- kfinance/CHANGELOG.md +7 -1
- kfinance/client/fetch.py +29 -19
- kfinance/client/kfinance.py +17 -18
- kfinance/client/meta_classes.py +12 -13
- kfinance/client/tests/test_fetch.py +51 -34
- kfinance/client/tests/test_objects.py +130 -129
- kfinance/conftest.py +49 -5
- kfinance/domains/business_relationships/business_relationship_tools.py +30 -19
- kfinance/domains/business_relationships/tests/test_business_relationship_tools.py +18 -15
- kfinance/domains/capitalizations/capitalization_models.py +1 -1
- kfinance/domains/capitalizations/capitalization_tools.py +41 -24
- kfinance/domains/capitalizations/tests/test_capitalization_tools.py +38 -13
- kfinance/domains/companies/company_identifiers.py +0 -175
- kfinance/domains/companies/company_models.py +98 -5
- kfinance/domains/companies/company_tools.py +33 -29
- kfinance/domains/companies/tests/test_company_tools.py +11 -4
- kfinance/domains/competitors/competitor_tools.py +21 -21
- kfinance/domains/competitors/tests/test_competitor_tools.py +21 -7
- kfinance/domains/cusip_and_isin/cusip_and_isin_tools.py +38 -26
- kfinance/domains/cusip_and_isin/tests/test_cusip_and_isin_tools.py +27 -26
- kfinance/domains/earnings/earning_tools.py +54 -47
- kfinance/domains/earnings/tests/test_earnings_tools.py +58 -63
- kfinance/domains/line_items/line_item_models.py +7 -0
- kfinance/domains/line_items/line_item_tools.py +31 -30
- kfinance/domains/line_items/tests/test_line_item_tools.py +23 -5
- kfinance/domains/mergers_and_acquisitions/merger_and_acquisition_models.py +15 -0
- kfinance/domains/mergers_and_acquisitions/merger_and_acquisition_tools.py +55 -38
- kfinance/domains/mergers_and_acquisitions/tests/test_merger_and_acquisition_tools.py +22 -9
- kfinance/domains/prices/price_models.py +9 -9
- kfinance/domains/prices/price_tools.py +49 -38
- kfinance/domains/prices/tests/test_price_tools.py +52 -36
- kfinance/domains/segments/segment_models.py +7 -0
- kfinance/domains/segments/segment_tools.py +37 -20
- kfinance/domains/segments/tests/test_segment_tools.py +13 -6
- kfinance/domains/statements/statement_models.py +7 -0
- kfinance/domains/statements/statement_tools.py +38 -40
- kfinance/domains/statements/tests/test_statement_tools.py +39 -10
- kfinance/integrations/tool_calling/tests/test_tool_calling_models.py +2 -2
- kfinance/integrations/tool_calling/tool_calling_models.py +24 -5
- kfinance/version.py +2 -2
- {kensho_kfinance-3.0.2.dist-info → kensho_kfinance-3.1.0.dist-info}/WHEEL +0 -0
- {kensho_kfinance-3.0.2.dist-info → kensho_kfinance-3.1.0.dist-info}/licenses/AUTHORS.md +0 -0
- {kensho_kfinance-3.0.2.dist-info → kensho_kfinance-3.1.0.dist-info}/licenses/LICENSE +0 -0
- {kensho_kfinance-3.0.2.dist-info → kensho_kfinance-3.1.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.0
|
|
3
|
+
Version: 3.1.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
|
|
@@ -1,18 +1,18 @@
|
|
|
1
|
-
kensho_kfinance-3.0.
|
|
2
|
-
kensho_kfinance-3.0.
|
|
3
|
-
kfinance/CHANGELOG.md,sha256=
|
|
1
|
+
kensho_kfinance-3.1.0.dist-info/licenses/AUTHORS.md,sha256=0h9ClbI0pu1oKj1M28ROUsaxrbZg-6ukQGl6X4y9noI,68
|
|
2
|
+
kensho_kfinance-3.1.0.dist-info/licenses/LICENSE,sha256=bsY4blvSgq6o0FMQ3RXa2NCgco--nHCCchLXzxr6kms,83
|
|
3
|
+
kfinance/CHANGELOG.md,sha256=HFCQeAbfhuhQ-Yhj9gPjNezoYJMs_dvfjjs6hhzv9RE,2576
|
|
4
4
|
kfinance/__init__.py,sha256=AbpHGcgLb-kRsJGnwFEktk7uzpZOCcBY74-YBdrKVGs,1
|
|
5
|
-
kfinance/conftest.py,sha256=
|
|
5
|
+
kfinance/conftest.py,sha256=O9e1ddyTfqnZ1T-9ehnkXwK8PfxPdCHAI7-fke52Ouk,3281
|
|
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=
|
|
8
|
+
kfinance/version.py,sha256=KrVRMDzlLQ07c4N1d6-nDOLo4hWpD8cSSFcYXWlm64k,511
|
|
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=
|
|
12
|
+
kfinance/client/fetch.py,sha256=Sd-Qcz9k37FHsUB-5OLxn2XimnneoW9Km3wKsiWBUO0,28652
|
|
13
13
|
kfinance/client/industry_models.py,sha256=ydB_cTIsNsfCUeaO7K2qqLUuHdG6WfUCoAzBigKVV8M,243
|
|
14
|
-
kfinance/client/kfinance.py,sha256=
|
|
15
|
-
kfinance/client/meta_classes.py,sha256=
|
|
14
|
+
kfinance/client/kfinance.py,sha256=9BMhXfmw5WzNl-xFdLvkvgJIr585F5rlM7YePwtlW7s,72684
|
|
15
|
+
kfinance/client/meta_classes.py,sha256=TQh43b8r3IEc7Br-XVaZP7IDx75F3MnCcLcu7Fd91PI,21442
|
|
16
16
|
kfinance/client/permission_models.py,sha256=G0so8ZOsD1YDsCM4he0z5R9M_shUbSRwD3hUDJdqZl0,635
|
|
17
17
|
kfinance/client/server_thread.py,sha256=jUnt1YGoYDkqqz1MbCwd44zJs1T_Z2BCgvj75bdtLgA,2574
|
|
18
18
|
kfinance/client/models/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
|
|
@@ -24,67 +24,68 @@ kfinance/client/models/tests/test_decimal_with_unit.py,sha256=7WlmVXFOFNHFqwsvXQ
|
|
|
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=
|
|
27
|
+
kfinance/client/tests/test_fetch.py,sha256=rr1fAKjcIVW5QHvIAGlOhh54RzkUpF-SVsTRIIeGzPw,18835
|
|
28
28
|
kfinance/client/tests/test_group_objects.py,sha256=wb7MEyGm-Qya3CXWM5Xz3kUhKFWdHT8FF3cQcjt1WxQ,1696
|
|
29
|
-
kfinance/client/tests/test_objects.py,sha256=
|
|
29
|
+
kfinance/client/tests/test_objects.py,sha256=eAEy1kAHS6JQDoXVU5uSyTQpV099F3xFZsbvgspWMn8,42623
|
|
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=
|
|
34
|
+
kfinance/domains/business_relationships/business_relationship_tools.py,sha256=2FqR4eRe99SmyuGQjYdxIwUfzUvq25A21QT_cXL_HOg,3337
|
|
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=
|
|
36
|
+
kfinance/domains/business_relationships/tests/test_business_relationship_tools.py,sha256=33x4ZmNS_VcbI6IMJ14JcSjdnKkeTOjtS_rP9aujfpM,2366
|
|
37
37
|
kfinance/domains/capitalizations/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
|
|
38
|
-
kfinance/domains/capitalizations/capitalization_models.py,sha256=
|
|
39
|
-
kfinance/domains/capitalizations/capitalization_tools.py,sha256
|
|
38
|
+
kfinance/domains/capitalizations/capitalization_models.py,sha256=2P0W48aZBfg5bG97PxyoHdcxdrdx7ZRKQ9TztyT1HNI,3361
|
|
39
|
+
kfinance/domains/capitalizations/capitalization_tools.py,sha256=-CM93IiGjsXg90ygUvxsj7d09CQ9nTvp7aGxedMEqo0,4703
|
|
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=
|
|
42
|
+
kfinance/domains/capitalizations/tests/test_capitalization_tools.py,sha256=LDjFiEEax2O65HQ65CY73J3y4RvuKjw5pqBO5imoUyY,4187
|
|
43
43
|
kfinance/domains/companies/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
|
|
44
|
-
kfinance/domains/companies/company_identifiers.py,sha256=
|
|
45
|
-
kfinance/domains/companies/company_models.py,sha256=
|
|
46
|
-
kfinance/domains/companies/company_tools.py,sha256=
|
|
44
|
+
kfinance/domains/companies/company_identifiers.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
|
|
45
|
+
kfinance/domains/companies/company_models.py,sha256=bQdBEKCKZDI-Xqiz_K-RsqVUC7xamTvvyPjmKLPwXNI,4379
|
|
46
|
+
kfinance/domains/companies/company_tools.py,sha256=iv4YlVFC485OPncwACj8lZybbUS9dDZ4Ezs3CB9QY4w,2786
|
|
47
47
|
kfinance/domains/companies/tests/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
|
|
48
|
-
kfinance/domains/companies/tests/test_company_tools.py,sha256=
|
|
48
|
+
kfinance/domains/companies/tests/test_company_tools.py,sha256=Gg0_Cep4hw_EcY50a_qKikWOwIX9nAi3eo_3rR1t398,1317
|
|
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=
|
|
51
|
+
kfinance/domains/competitors/competitor_tools.py,sha256=W_vRMng5UG1csJWDZKDxibrvXzUcwwnN9hw5cSg4EHI,2551
|
|
52
52
|
kfinance/domains/competitors/tests/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
|
|
53
|
-
kfinance/domains/competitors/tests/test_competitor_tools.py,sha256=
|
|
53
|
+
kfinance/domains/competitors/tests/test_competitor_tools.py,sha256=GL03SBGU2XKejh6Y1F1wwtvNLmoOLGxuysLAHO0khRU,2377
|
|
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=
|
|
55
|
+
kfinance/domains/cusip_and_isin/cusip_and_isin_tools.py,sha256=G9wASgsa_RN9wC1jjTJcVzGXnmYehAwNeJ1HyOts3wg,3469
|
|
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
|
|
57
|
+
kfinance/domains/cusip_and_isin/tests/test_cusip_and_isin_tools.py,sha256=lEVgf6Bf54ddOAisutC5wZjtePGvM_-HPb5xY6Y7MqU,2252
|
|
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=
|
|
60
|
+
kfinance/domains/earnings/earning_tools.py,sha256=2yhb8PK56bXHQZ3EGL9-645t56FgMTLbVooFklBD8OE,6900
|
|
61
61
|
kfinance/domains/earnings/tests/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
|
|
62
|
-
kfinance/domains/earnings/tests/test_earnings_tools.py,sha256=
|
|
62
|
+
kfinance/domains/earnings/tests/test_earnings_tools.py,sha256=HmCaDW5a7gKWu2tKRrgjCX0xYk6FdoQBbNfGp2lwaiI,6462
|
|
63
63
|
kfinance/domains/line_items/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
|
|
64
|
-
kfinance/domains/line_items/line_item_models.py,sha256=
|
|
65
|
-
kfinance/domains/line_items/line_item_tools.py,sha256=
|
|
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=xRhK3JWWO44fYpOiJWAvOKrGesQ-zUuXB90anjEFOmo,4950
|
|
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=
|
|
67
|
+
kfinance/domains/line_items/tests/test_line_item_tools.py,sha256=kZXbi_2oaR5cxxQk9Qj7pY0bvL7G3ch9-z9mprvxMGo,4106
|
|
68
68
|
kfinance/domains/mergers_and_acquisitions/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
|
|
69
|
-
kfinance/domains/mergers_and_acquisitions/
|
|
69
|
+
kfinance/domains/mergers_and_acquisitions/merger_and_acquisition_models.py,sha256=TLDYiR2TX-gb13px7xEYzOuYpwqRDjKCSnJFJaeAI8o,287
|
|
70
|
+
kfinance/domains/mergers_and_acquisitions/merger_and_acquisition_tools.py,sha256=mSFFOODsWAh2qF5hrwjYU4Yr7pp9NtILdc_jNmgpSSM,8063
|
|
70
71
|
kfinance/domains/mergers_and_acquisitions/tests/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
|
|
71
|
-
kfinance/domains/mergers_and_acquisitions/tests/test_merger_and_acquisition_tools.py,sha256=
|
|
72
|
+
kfinance/domains/mergers_and_acquisitions/tests/test_merger_and_acquisition_tools.py,sha256=h9h8Z2fW3nZ-1f81C9gKn3GcnKvzvmvQJGjQGIqfauU,5924
|
|
72
73
|
kfinance/domains/prices/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
|
|
73
|
-
kfinance/domains/prices/price_models.py,sha256=
|
|
74
|
-
kfinance/domains/prices/price_tools.py,sha256=
|
|
74
|
+
kfinance/domains/prices/price_models.py,sha256=6K2Yi8PQKJ92rf6ulcOSh9rBVOiPcUQD_WIRjpIRuSo,2156
|
|
75
|
+
kfinance/domains/prices/price_tools.py,sha256=KrcJz3GT8iQElfLp0pArVVcV-jckX_Ggj4lgO0s3wkE,7192
|
|
75
76
|
kfinance/domains/prices/tests/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
|
|
76
77
|
kfinance/domains/prices/tests/test_price_models.py,sha256=PWGqbR9aCys2ldHZMF5anMXsSYEVOjgygfpxLcLVKL8,2400
|
|
77
|
-
kfinance/domains/prices/tests/test_price_tools.py,sha256=
|
|
78
|
+
kfinance/domains/prices/tests/test_price_tools.py,sha256=2jCx79TyqZ7naKQrHm421vDX3zBgj-0kaas1TX5LpfA,5995
|
|
78
79
|
kfinance/domains/segments/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
|
|
79
|
-
kfinance/domains/segments/segment_models.py,sha256=
|
|
80
|
-
kfinance/domains/segments/segment_tools.py,sha256=
|
|
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
82
|
kfinance/domains/segments/tests/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
|
|
82
|
-
kfinance/domains/segments/tests/test_segment_tools.py,sha256=
|
|
83
|
+
kfinance/domains/segments/tests/test_segment_tools.py,sha256=bz7CTKvIW2BbIbavXvXl2HuCIzh9MGaYu12q8w32KiY,3360
|
|
83
84
|
kfinance/domains/statements/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
|
|
84
|
-
kfinance/domains/statements/statement_models.py,sha256=
|
|
85
|
-
kfinance/domains/statements/statement_tools.py,sha256=
|
|
85
|
+
kfinance/domains/statements/statement_models.py,sha256=f7jEejuvMbsW9paqHIJ19DKUX3XL_qzf74jZBKDamfE,328
|
|
86
|
+
kfinance/domains/statements/statement_tools.py,sha256=XSbyll3RDY6aGG90MmUnWcVpii7AIr6A4zvd6G6V3ks,4918
|
|
86
87
|
kfinance/domains/statements/tests/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
|
|
87
|
-
kfinance/domains/statements/tests/test_statement_tools.py,sha256=
|
|
88
|
+
kfinance/domains/statements/tests/test_statement_tools.py,sha256=E-wIgnCF1946odDPc2dOh1K5xXIA59kEPrkILPwXwsw,4003
|
|
88
89
|
kfinance/integrations/README.md,sha256=GalSN11UHzbLfcNzKAlObNbw5XqMKVXSVzzGlryM3zc,320
|
|
89
90
|
kfinance/integrations/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
|
|
90
91
|
kfinance/integrations/local_mcp/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
|
|
@@ -95,7 +96,7 @@ kfinance/integrations/tool_calling/README.md,sha256=TSk-AJddoEctzc0HXQvGNac2Cckb
|
|
|
95
96
|
kfinance/integrations/tool_calling/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
|
|
96
97
|
kfinance/integrations/tool_calling/all_tools.py,sha256=MbvAZX2yEyovGtBNcr5f6n2G_lV5Zc9nnSn7xgH3zjQ,2115
|
|
97
98
|
kfinance/integrations/tool_calling/prompts.py,sha256=cLslVoubJyuh4W2-Eeok2dLOV4R7wUQGCu1HeQ1kNQo,1005
|
|
98
|
-
kfinance/integrations/tool_calling/tool_calling_models.py,sha256=
|
|
99
|
+
kfinance/integrations/tool_calling/tool_calling_models.py,sha256=o1LGGwx8ikwEiZaHEALS4rvymF9O1Mp5dO9LcfFheUI,5856
|
|
99
100
|
kfinance/integrations/tool_calling/static_tools/README.md,sha256=lWQWdLY1tkGxqE8o4f61gc-RCX0doaCnZM0GmcNO6Jo,97
|
|
100
101
|
kfinance/integrations/tool_calling/static_tools/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
|
|
101
102
|
kfinance/integrations/tool_calling/static_tools/get_latest.py,sha256=pSLjofq9E6cQqGSFC73KmVpLATk9t5e-dUChsRmYUIQ,883
|
|
@@ -104,9 +105,9 @@ kfinance/integrations/tool_calling/static_tools/tests/__init__.py,sha256=47DEQpj
|
|
|
104
105
|
kfinance/integrations/tool_calling/static_tools/tests/test_get_lastest.py,sha256=26CpdDcb-Ai3w-6qPVRRFPdlT2EKAFuOWkIRhxvb_Fk,989
|
|
105
106
|
kfinance/integrations/tool_calling/static_tools/tests/test_get_n_quarters_ago.py,sha256=r7wtp7ttcJkKi2DQd42nzjfSXcpZAL97SrbltnjHuEI,775
|
|
106
107
|
kfinance/integrations/tool_calling/tests/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
|
|
107
|
-
kfinance/integrations/tool_calling/tests/test_tool_calling_models.py,sha256=
|
|
108
|
+
kfinance/integrations/tool_calling/tests/test_tool_calling_models.py,sha256=Ts1pvaYjq9BTR71dMZ73X__bQ7gQynPkQjy-9x2CuyQ,2605
|
|
108
109
|
kfinance/models/permission_models.py,sha256=G0so8ZOsD1YDsCM4he0z5R9M_shUbSRwD3hUDJdqZl0,635
|
|
109
|
-
kensho_kfinance-3.0.
|
|
110
|
-
kensho_kfinance-3.0.
|
|
111
|
-
kensho_kfinance-3.0.
|
|
112
|
-
kensho_kfinance-3.0.
|
|
110
|
+
kensho_kfinance-3.1.0.dist-info/METADATA,sha256=7xNJrtPsw2Z745G3XYikUwicoR7Iq8fmHEof3Wq0t_0,6202
|
|
111
|
+
kensho_kfinance-3.1.0.dist-info/WHEEL,sha256=_zCd3N1l69ArxyTb8rzEoP9TpbYXkqRFSNOD5OuxnTs,91
|
|
112
|
+
kensho_kfinance-3.1.0.dist-info/top_level.txt,sha256=kT_kNwVhfQoOAecY8W7uYah5xaHMoHoAdBIvXh6DaKM,9
|
|
113
|
+
kensho_kfinance-3.1.0.dist-info/RECORD,,
|
kfinance/CHANGELOG.md
CHANGED
|
@@ -1,5 +1,11 @@
|
|
|
1
1
|
# Changelog
|
|
2
2
|
|
|
3
|
+
## v3.1.0
|
|
4
|
+
- Use unified endpoint for company resolution
|
|
5
|
+
|
|
6
|
+
## v3.0.3
|
|
7
|
+
- Add LineItemResponse model
|
|
8
|
+
|
|
3
9
|
## v3.0.2
|
|
4
10
|
- Add kfinance.mcp back to simplify transition to 3.0
|
|
5
11
|
|
|
@@ -25,7 +31,7 @@
|
|
|
25
31
|
- Add transcript permission and update accepted_permissions type to set[Permission]
|
|
26
32
|
|
|
27
33
|
## v2.6.3
|
|
28
|
-
- Bump urllib3 to 2.5 to
|
|
34
|
+
- Bump urllib3 to 2.5 to address CVEs
|
|
29
35
|
|
|
30
36
|
## v2.6.2
|
|
31
37
|
- Safely check for incomplete merger information
|
kfinance/client/fetch.py
CHANGED
|
@@ -17,11 +17,14 @@ from kfinance.domains.business_relationships.business_relationship_models import
|
|
|
17
17
|
RelationshipResponse,
|
|
18
18
|
)
|
|
19
19
|
from kfinance.domains.capitalizations.capitalization_models import Capitalizations
|
|
20
|
-
from kfinance.domains.companies.company_models import IdentificationTriple
|
|
20
|
+
from kfinance.domains.companies.company_models import IdentificationTriple, UnifiedIdTripleResponse
|
|
21
21
|
from kfinance.domains.competitors.competitor_models import CompetitorResponse, CompetitorSource
|
|
22
22
|
from kfinance.domains.earnings.earning_models import EarningsCallResp
|
|
23
|
-
from kfinance.domains.
|
|
24
|
-
from kfinance.domains.
|
|
23
|
+
from kfinance.domains.line_items.line_item_models import LineItemResponse
|
|
24
|
+
from kfinance.domains.mergers_and_acquisitions.merger_and_acquisition_models import MergersResp
|
|
25
|
+
from kfinance.domains.prices.price_models import HistoryMetadataResp, PriceHistory
|
|
26
|
+
from kfinance.domains.segments.segment_models import SegmentsResp, SegmentType
|
|
27
|
+
from kfinance.domains.statements.statement_models import StatementsResp
|
|
25
28
|
|
|
26
29
|
|
|
27
30
|
# version.py gets autogenerated by setuptools-scm and is not available
|
|
@@ -226,7 +229,7 @@ class KFinanceApiClient:
|
|
|
226
229
|
finally:
|
|
227
230
|
self._endpoint_tracker_queue = None
|
|
228
231
|
|
|
229
|
-
def fetch(self, url: str) -> dict:
|
|
232
|
+
def fetch(self, url: str, method: str = "GET", request_body: dict | None = None) -> dict:
|
|
230
233
|
"""Does the request and auth"""
|
|
231
234
|
|
|
232
235
|
# _endpoint_tracker_queue will only be initialized if inside the endpoint_tracker context manager
|
|
@@ -244,9 +247,11 @@ class KFinanceApiClient:
|
|
|
244
247
|
{"Kfinance-Batch-Id": self._batch_id, "Kfinance-Batch-Size": self._batch_size}
|
|
245
248
|
)
|
|
246
249
|
|
|
247
|
-
response = requests.
|
|
248
|
-
|
|
250
|
+
response = requests.request(
|
|
251
|
+
method=method,
|
|
252
|
+
url=url,
|
|
249
253
|
headers=headers,
|
|
254
|
+
json=request_body,
|
|
250
255
|
timeout=60,
|
|
251
256
|
)
|
|
252
257
|
response.raise_for_status()
|
|
@@ -289,6 +294,12 @@ class KFinanceApiClient:
|
|
|
289
294
|
url = f"{self.url_base}trading_items/{security_id}/primary"
|
|
290
295
|
return self.fetch(url)
|
|
291
296
|
|
|
297
|
+
def unified_fetch_id_triples(self, identifiers: list[str]) -> UnifiedIdTripleResponse:
|
|
298
|
+
"""Resolve one or more identifiers to id triples using the unified (/ids) endpoint."""
|
|
299
|
+
url = f"{self.url_base}ids"
|
|
300
|
+
resp = self.fetch(url=url, method="POST", request_body=dict(identifiers=identifiers))
|
|
301
|
+
return UnifiedIdTripleResponse.model_validate(resp)
|
|
302
|
+
|
|
292
303
|
def fetch_trading_items(self, security_id: int) -> dict:
|
|
293
304
|
"""Get the list of trading items of a security."""
|
|
294
305
|
url = f"{self.url_base}trading_items/{security_id}"
|
|
@@ -312,10 +323,10 @@ class KFinanceApiClient:
|
|
|
312
323
|
)
|
|
313
324
|
return PriceHistory.model_validate(self.fetch(url))
|
|
314
325
|
|
|
315
|
-
def fetch_history_metadata(self, trading_item_id: int) ->
|
|
326
|
+
def fetch_history_metadata(self, trading_item_id: int) -> HistoryMetadataResp:
|
|
316
327
|
"""Get the pricing history metadata."""
|
|
317
328
|
url = f"{self.url_base}pricing/{trading_item_id}/metadata"
|
|
318
|
-
return self.fetch(url)
|
|
329
|
+
return HistoryMetadataResp.model_validate(self.fetch(url))
|
|
319
330
|
|
|
320
331
|
def fetch_market_caps_tevs_and_shares_outstanding(
|
|
321
332
|
self,
|
|
@@ -340,7 +351,7 @@ class KFinanceApiClient:
|
|
|
340
351
|
end_year: Optional[int] = None,
|
|
341
352
|
start_quarter: Optional[int] = None,
|
|
342
353
|
end_quarter: Optional[int] = None,
|
|
343
|
-
) ->
|
|
354
|
+
) -> SegmentsResp:
|
|
344
355
|
"""Get a specified segment type for a specified duration."""
|
|
345
356
|
url = (
|
|
346
357
|
f"{self.url_base}segments/{company_id}/{segment_type}/"
|
|
@@ -350,7 +361,7 @@ class KFinanceApiClient:
|
|
|
350
361
|
f"{start_quarter if start_quarter is not None else 'none'}/"
|
|
351
362
|
f"{end_quarter if end_quarter is not None else 'none'}"
|
|
352
363
|
)
|
|
353
|
-
return self.fetch(url)
|
|
364
|
+
return SegmentsResp.model_validate(self.fetch(url))
|
|
354
365
|
|
|
355
366
|
def fetch_price_chart(
|
|
356
367
|
self,
|
|
@@ -389,7 +400,7 @@ class KFinanceApiClient:
|
|
|
389
400
|
end_year: Optional[int] = None,
|
|
390
401
|
start_quarter: Optional[int] = None,
|
|
391
402
|
end_quarter: Optional[int] = None,
|
|
392
|
-
) ->
|
|
403
|
+
) -> StatementsResp:
|
|
393
404
|
"""Get a specified financial statement for a specified duration."""
|
|
394
405
|
url = (
|
|
395
406
|
f"{self.url_base}statements/{company_id}/{statement_type}/"
|
|
@@ -399,7 +410,7 @@ class KFinanceApiClient:
|
|
|
399
410
|
f"{start_quarter if start_quarter is not None else 'none'}/"
|
|
400
411
|
f"{end_quarter if end_quarter is not None else 'none'}"
|
|
401
412
|
)
|
|
402
|
-
return self.fetch(url)
|
|
413
|
+
return StatementsResp.model_validate(self.fetch(url))
|
|
403
414
|
|
|
404
415
|
def fetch_line_item(
|
|
405
416
|
self,
|
|
@@ -410,7 +421,7 @@ class KFinanceApiClient:
|
|
|
410
421
|
end_year: Optional[int] = None,
|
|
411
422
|
start_quarter: Optional[int] = None,
|
|
412
423
|
end_quarter: Optional[int] = None,
|
|
413
|
-
) ->
|
|
424
|
+
) -> LineItemResponse:
|
|
414
425
|
"""Get a specified financial line item for a specified duration."""
|
|
415
426
|
url = (
|
|
416
427
|
f"{self.url_base}line_item/{company_id}/{line_item}/"
|
|
@@ -420,7 +431,7 @@ class KFinanceApiClient:
|
|
|
420
431
|
f"{start_quarter if start_quarter is not None else 'none'}/"
|
|
421
432
|
f"{end_quarter if end_quarter is not None else 'none'}"
|
|
422
433
|
)
|
|
423
|
-
return self.fetch(url)
|
|
434
|
+
return LineItemResponse.model_validate(self.fetch(url))
|
|
424
435
|
|
|
425
436
|
def fetch_info(self, company_id: int) -> dict:
|
|
426
437
|
"""Get the company info."""
|
|
@@ -603,17 +614,16 @@ class KFinanceApiClient:
|
|
|
603
614
|
def fetch_mergers_for_company(
|
|
604
615
|
self,
|
|
605
616
|
company_id: int,
|
|
606
|
-
) ->
|
|
617
|
+
) -> MergersResp:
|
|
607
618
|
"""Fetches the mergers and acquisitions the given company was involved in.
|
|
608
619
|
|
|
609
|
-
Returns a dictionary of shape {"target", [{"transaction_id": <transaction_id>, "merger_title": <merger short title>}], "buyer": [...], "seller": [...]}
|
|
610
620
|
:param company_id: The company ID to filter on.
|
|
611
621
|
:type company_id: int
|
|
612
|
-
:return: A
|
|
613
|
-
:rtype:
|
|
622
|
+
:return: A MergersResp, containing transaction IDs, closed_date, and 'merger titles' for each of the three kinds of roles the given company could be party to.
|
|
623
|
+
:rtype: MergersResp
|
|
614
624
|
"""
|
|
615
625
|
url = f"{self.url_base}mergers/{company_id}"
|
|
616
|
-
return self.fetch(url)
|
|
626
|
+
return MergersResp.model_validate(self.fetch(url))
|
|
617
627
|
|
|
618
628
|
def fetch_merger_info(
|
|
619
629
|
self,
|
kfinance/client/kfinance.py
CHANGED
|
@@ -38,7 +38,7 @@ from kfinance.client.models.date_and_period_models import (
|
|
|
38
38
|
from kfinance.client.server_thread import ServerThread
|
|
39
39
|
from kfinance.domains.companies.company_models import IdentificationTriple
|
|
40
40
|
from kfinance.domains.earnings.earning_models import EarningsCall, TranscriptComponent
|
|
41
|
-
from kfinance.domains.prices.price_models import
|
|
41
|
+
from kfinance.domains.prices.price_models import HistoryMetadataResp, PriceHistory
|
|
42
42
|
|
|
43
43
|
|
|
44
44
|
if TYPE_CHECKING:
|
|
@@ -78,7 +78,7 @@ class TradingItem:
|
|
|
78
78
|
self.trading_item_id = trading_item_id
|
|
79
79
|
|
|
80
80
|
self._ticker: str | None = None
|
|
81
|
-
self._history_metadata:
|
|
81
|
+
self._history_metadata: HistoryMetadataResp | None = None
|
|
82
82
|
|
|
83
83
|
def __str__(self) -> str:
|
|
84
84
|
"""String representation for the company object"""
|
|
@@ -105,20 +105,15 @@ class TradingItem:
|
|
|
105
105
|
return trading_item
|
|
106
106
|
|
|
107
107
|
@property
|
|
108
|
-
def history_metadata(self) ->
|
|
108
|
+
def history_metadata(self) -> HistoryMetadataResp:
|
|
109
109
|
"""Get information about exchange and quotation
|
|
110
110
|
|
|
111
111
|
:return: A dict containing data about the currency, symbol, exchange, type of instrument, and the first trading date
|
|
112
112
|
:rtype: HistoryMetadata
|
|
113
113
|
"""
|
|
114
114
|
if self._history_metadata is None:
|
|
115
|
-
|
|
116
|
-
|
|
117
|
-
currency=metadata["currency"],
|
|
118
|
-
symbol=metadata["symbol"],
|
|
119
|
-
exchange_name=metadata["exchange_name"],
|
|
120
|
-
instrument_type=metadata["instrument_type"],
|
|
121
|
-
first_trade_date=datetime.strptime(metadata["first_trade_date"], "%Y-%m-%d").date(),
|
|
115
|
+
self._history_metadata = self.kfinance_api_client.fetch_history_metadata(
|
|
116
|
+
self.trading_item_id
|
|
122
117
|
)
|
|
123
118
|
return self._history_metadata
|
|
124
119
|
|
|
@@ -129,7 +124,7 @@ class TradingItem:
|
|
|
129
124
|
:return: The exchange code of the trading item.
|
|
130
125
|
:rtype: str
|
|
131
126
|
"""
|
|
132
|
-
return self.history_metadata
|
|
127
|
+
return self.history_metadata.exchange_name
|
|
133
128
|
|
|
134
129
|
def history(
|
|
135
130
|
self,
|
|
@@ -635,7 +630,7 @@ class Company(CompanyFunctionsMetaClass):
|
|
|
635
630
|
if self._mergers_for_company is None:
|
|
636
631
|
mergers_for_company = self.kfinance_api_client.fetch_mergers_for_company(
|
|
637
632
|
company_id=self.company_id
|
|
638
|
-
)
|
|
633
|
+
).model_dump(mode="json")
|
|
639
634
|
output: dict = {}
|
|
640
635
|
for literal in ["target", "buyer", "seller"]:
|
|
641
636
|
output[literal] = MergersAndAcquisitions(
|
|
@@ -872,7 +867,7 @@ class Ticker(DelegatedCompanyFunctionsMetaClass):
|
|
|
872
867
|
self._primary_security: Security | None = None
|
|
873
868
|
self._primary_trading_item: TradingItem | None = None
|
|
874
869
|
self._company: Company | None = None
|
|
875
|
-
self._history_metadata:
|
|
870
|
+
self._history_metadata: HistoryMetadataResp | None = None
|
|
876
871
|
|
|
877
872
|
@property
|
|
878
873
|
def id_triple(self) -> IdentificationTriple:
|
|
@@ -946,6 +941,8 @@ class Ticker(DelegatedCompanyFunctionsMetaClass):
|
|
|
946
941
|
:return: the CIQ security id
|
|
947
942
|
:rtype: int
|
|
948
943
|
"""
|
|
944
|
+
if self.id_triple.security_id is None:
|
|
945
|
+
raise ValueError(f"Ticker {self.ticker} does not have a security_id.")
|
|
949
946
|
return self.id_triple.security_id
|
|
950
947
|
|
|
951
948
|
@property
|
|
@@ -955,6 +952,8 @@ class Ticker(DelegatedCompanyFunctionsMetaClass):
|
|
|
955
952
|
:return: the CIQ trading item id
|
|
956
953
|
:rtype: int
|
|
957
954
|
"""
|
|
955
|
+
if self.id_triple.trading_item_id is None:
|
|
956
|
+
raise ValueError(f"Ticker {self.ticker} does not have a trading_item_id.")
|
|
958
957
|
return self.id_triple.trading_item_id
|
|
959
958
|
|
|
960
959
|
@property
|
|
@@ -1158,7 +1157,7 @@ class Ticker(DelegatedCompanyFunctionsMetaClass):
|
|
|
1158
1157
|
return self.company.earnings_call_datetimes
|
|
1159
1158
|
|
|
1160
1159
|
@property
|
|
1161
|
-
def history_metadata(self) ->
|
|
1160
|
+
def history_metadata(self) -> HistoryMetadataResp:
|
|
1162
1161
|
"""Get information about exchange and quotation
|
|
1163
1162
|
|
|
1164
1163
|
:return: A dict containing data about the currency, symbol, exchange, type of instrument, and the first trading date
|
|
@@ -1166,9 +1165,9 @@ class Ticker(DelegatedCompanyFunctionsMetaClass):
|
|
|
1166
1165
|
"""
|
|
1167
1166
|
metadata = self.primary_trading_item.history_metadata
|
|
1168
1167
|
if self.exchange_code is None:
|
|
1169
|
-
self.exchange_code = metadata
|
|
1168
|
+
self.exchange_code = metadata.exchange_name
|
|
1170
1169
|
if self._ticker is None:
|
|
1171
|
-
self._ticker = metadata
|
|
1170
|
+
self._ticker = metadata.symbol
|
|
1172
1171
|
return metadata
|
|
1173
1172
|
|
|
1174
1173
|
@property
|
|
@@ -1176,7 +1175,7 @@ class Ticker(DelegatedCompanyFunctionsMetaClass):
|
|
|
1176
1175
|
"""Get the ticker if it isn't available from initialization"""
|
|
1177
1176
|
if self._ticker is not None:
|
|
1178
1177
|
return self._ticker
|
|
1179
|
-
return self.history_metadata
|
|
1178
|
+
return self.history_metadata.symbol
|
|
1180
1179
|
|
|
1181
1180
|
def history(
|
|
1182
1181
|
self,
|
|
@@ -1870,7 +1869,7 @@ class Client:
|
|
|
1870
1869
|
"""
|
|
1871
1870
|
mergers_for_company = self.kfinance_api_client.fetch_mergers_for_company(
|
|
1872
1871
|
company_id=company_id
|
|
1873
|
-
)
|
|
1872
|
+
).model_dump(mode="json")
|
|
1874
1873
|
output: dict = {}
|
|
1875
1874
|
for literal in ["target", "buyer", "seller"]:
|
|
1876
1875
|
output[literal] = MergersAndAcquisitions(
|
kfinance/client/meta_classes.py
CHANGED
|
@@ -85,7 +85,7 @@ class CompanyFunctionsMetaClass:
|
|
|
85
85
|
end_year=end_year,
|
|
86
86
|
start_quarter=start_quarter,
|
|
87
87
|
end_quarter=end_quarter,
|
|
88
|
-
)["statements"]
|
|
88
|
+
).model_dump(mode="json")["statements"]
|
|
89
89
|
)
|
|
90
90
|
.apply(pd.to_numeric)
|
|
91
91
|
.replace(np.nan, None)
|
|
@@ -202,18 +202,17 @@ class CompanyFunctionsMetaClass:
|
|
|
202
202
|
except ValueError:
|
|
203
203
|
return pd.DataFrame()
|
|
204
204
|
|
|
205
|
+
line_item_response = self.kfinance_api_client.fetch_line_item(
|
|
206
|
+
company_id=self.company_id,
|
|
207
|
+
line_item=line_item,
|
|
208
|
+
period_type=period_type,
|
|
209
|
+
start_year=start_year,
|
|
210
|
+
end_year=end_year,
|
|
211
|
+
start_quarter=start_quarter,
|
|
212
|
+
end_quarter=end_quarter,
|
|
213
|
+
)
|
|
205
214
|
return (
|
|
206
|
-
pd.DataFrame(
|
|
207
|
-
self.kfinance_api_client.fetch_line_item(
|
|
208
|
-
company_id=self.company_id,
|
|
209
|
-
line_item=line_item,
|
|
210
|
-
period_type=period_type,
|
|
211
|
-
start_year=start_year,
|
|
212
|
-
end_year=end_year,
|
|
213
|
-
start_quarter=start_quarter,
|
|
214
|
-
end_quarter=end_quarter,
|
|
215
|
-
)
|
|
216
|
-
)
|
|
215
|
+
pd.DataFrame({"line_item": line_item_response.line_item})
|
|
217
216
|
.transpose()
|
|
218
217
|
.apply(pd.to_numeric)
|
|
219
218
|
.replace(np.nan, None)
|
|
@@ -350,7 +349,7 @@ class CompanyFunctionsMetaClass:
|
|
|
350
349
|
end_year=end_year,
|
|
351
350
|
start_quarter=start_quarter,
|
|
352
351
|
end_quarter=end_quarter,
|
|
353
|
-
)["segments"]
|
|
352
|
+
).model_dump(mode="json")["segments"]
|
|
354
353
|
|
|
355
354
|
def business_segments(
|
|
356
355
|
self,
|
|
@@ -83,16 +83,20 @@ class TestFetchItem(TestCase):
|
|
|
83
83
|
expected_fetch_url = (
|
|
84
84
|
f"{self.kfinance_api_client.url_base}pricing/{trading_item_id}/metadata"
|
|
85
85
|
)
|
|
86
|
-
|
|
86
|
+
# Validation error is ok, we only care that the function was called with the correct url
|
|
87
|
+
with pytest.raises(ValidationError):
|
|
88
|
+
self.kfinance_api_client.fetch_history_metadata(trading_item_id=trading_item_id)
|
|
87
89
|
self.kfinance_api_client.fetch.assert_called_once_with(expected_fetch_url)
|
|
88
90
|
|
|
89
91
|
def test_fetch_statement(self) -> None:
|
|
90
92
|
company_id = 21719
|
|
91
93
|
statement_type = "BS"
|
|
92
94
|
expected_fetch_url = f"{self.kfinance_api_client.url_base}statements/{company_id}/{statement_type}/none/none/none/none/none"
|
|
93
|
-
|
|
94
|
-
|
|
95
|
-
|
|
95
|
+
# Validation error is ok, we only care that the function was called with the correct url
|
|
96
|
+
with pytest.raises(ValidationError):
|
|
97
|
+
self.kfinance_api_client.fetch_statement(
|
|
98
|
+
company_id=company_id, statement_type=statement_type
|
|
99
|
+
)
|
|
96
100
|
self.kfinance_api_client.fetch.assert_called_with(expected_fetch_url)
|
|
97
101
|
period_type = PeriodType.quarterly
|
|
98
102
|
start_year = 2024
|
|
@@ -100,22 +104,26 @@ class TestFetchItem(TestCase):
|
|
|
100
104
|
start_quarter = 1
|
|
101
105
|
end_quarter = 4
|
|
102
106
|
expected_fetch_url = f"{self.kfinance_api_client.url_base}statements/{company_id}/{statement_type}/{period_type.value}/{start_year}/{end_year}/{start_quarter}/{end_quarter}"
|
|
103
|
-
|
|
104
|
-
|
|
105
|
-
|
|
106
|
-
|
|
107
|
-
|
|
108
|
-
|
|
109
|
-
|
|
110
|
-
|
|
111
|
-
|
|
107
|
+
# Validation error is ok, we only care that the function was called with the correct url
|
|
108
|
+
with pytest.raises(ValidationError):
|
|
109
|
+
self.kfinance_api_client.fetch_statement(
|
|
110
|
+
company_id=company_id,
|
|
111
|
+
statement_type=statement_type,
|
|
112
|
+
period_type=period_type,
|
|
113
|
+
start_year=start_year,
|
|
114
|
+
end_year=end_year,
|
|
115
|
+
start_quarter=start_quarter,
|
|
116
|
+
end_quarter=end_quarter,
|
|
117
|
+
)
|
|
112
118
|
self.kfinance_api_client.fetch.assert_called_with(expected_fetch_url)
|
|
113
119
|
|
|
114
120
|
def test_fetch_line_item(self) -> None:
|
|
115
121
|
company_id = 21719
|
|
116
122
|
line_item = "cash"
|
|
117
123
|
expected_fetch_url = f"{self.kfinance_api_client.url_base}line_item/{company_id}/{line_item}/none/none/none/none/none"
|
|
118
|
-
|
|
124
|
+
# Validation error is ok, we only care that the function was called with the correct url
|
|
125
|
+
with pytest.raises(ValidationError):
|
|
126
|
+
self.kfinance_api_client.fetch_line_item(company_id=company_id, line_item=line_item)
|
|
119
127
|
self.kfinance_api_client.fetch.assert_called_with(expected_fetch_url)
|
|
120
128
|
period_type = PeriodType.quarterly
|
|
121
129
|
start_year = 2024
|
|
@@ -123,15 +131,18 @@ class TestFetchItem(TestCase):
|
|
|
123
131
|
start_quarter = 1
|
|
124
132
|
end_quarter = 4
|
|
125
133
|
expected_fetch_url = f"{self.kfinance_api_client.url_base}line_item/{company_id}/{line_item}/{period_type.value}/{start_year}/{end_year}/{start_quarter}/{end_quarter}"
|
|
126
|
-
|
|
127
|
-
|
|
128
|
-
|
|
129
|
-
|
|
130
|
-
|
|
131
|
-
|
|
132
|
-
|
|
133
|
-
|
|
134
|
-
|
|
134
|
+
|
|
135
|
+
# Validation error is ok, we only care that the function was called with the correct url
|
|
136
|
+
with pytest.raises(ValidationError):
|
|
137
|
+
self.kfinance_api_client.fetch_line_item(
|
|
138
|
+
company_id=company_id,
|
|
139
|
+
line_item=line_item,
|
|
140
|
+
period_type=period_type,
|
|
141
|
+
start_year=start_year,
|
|
142
|
+
end_year=end_year,
|
|
143
|
+
start_quarter=start_quarter,
|
|
144
|
+
end_quarter=end_quarter,
|
|
145
|
+
)
|
|
135
146
|
self.kfinance_api_client.fetch.assert_called_with(expected_fetch_url)
|
|
136
147
|
|
|
137
148
|
def test_fetch_info(self) -> None:
|
|
@@ -262,7 +273,10 @@ class TestFetchItem(TestCase):
|
|
|
262
273
|
company_id = 21719
|
|
263
274
|
segment_type = "business"
|
|
264
275
|
expected_fetch_url = f"{self.kfinance_api_client.url_base}segments/{company_id}/{segment_type}/none/none/none/none/none"
|
|
265
|
-
|
|
276
|
+
with pytest.raises(ValidationError):
|
|
277
|
+
self.kfinance_api_client.fetch_segments(
|
|
278
|
+
company_id=company_id, segment_type=segment_type
|
|
279
|
+
)
|
|
266
280
|
self.kfinance_api_client.fetch.assert_called_with(expected_fetch_url)
|
|
267
281
|
period_type = PeriodType.quarterly
|
|
268
282
|
start_year = 2023
|
|
@@ -270,21 +284,24 @@ class TestFetchItem(TestCase):
|
|
|
270
284
|
start_quarter = 1
|
|
271
285
|
end_quarter = 4
|
|
272
286
|
expected_fetch_url = f"{self.kfinance_api_client.url_base}segments/{company_id}/{segment_type}/{period_type.value}/{start_year}/{end_year}/{start_quarter}/{end_quarter}"
|
|
273
|
-
|
|
274
|
-
|
|
275
|
-
|
|
276
|
-
|
|
277
|
-
|
|
278
|
-
|
|
279
|
-
|
|
280
|
-
|
|
281
|
-
|
|
287
|
+
with pytest.raises(ValidationError):
|
|
288
|
+
self.kfinance_api_client.fetch_segments(
|
|
289
|
+
company_id=company_id,
|
|
290
|
+
segment_type=segment_type,
|
|
291
|
+
period_type=period_type,
|
|
292
|
+
start_year=start_year,
|
|
293
|
+
end_year=end_year,
|
|
294
|
+
start_quarter=start_quarter,
|
|
295
|
+
end_quarter=end_quarter,
|
|
296
|
+
)
|
|
282
297
|
self.kfinance_api_client.fetch.assert_called_with(expected_fetch_url)
|
|
283
298
|
|
|
284
299
|
def test_fetch_mergers_for_company(self) -> None:
|
|
285
300
|
company_id = 21719
|
|
286
301
|
expected_fetch_url = f"{self.kfinance_api_client.url_base}mergers/{company_id}"
|
|
287
|
-
|
|
302
|
+
# Validation error is ok, we only care that the function was called with the correct url
|
|
303
|
+
with pytest.raises(ValidationError):
|
|
304
|
+
self.kfinance_api_client.fetch_mergers_for_company(company_id=company_id)
|
|
288
305
|
self.kfinance_api_client.fetch.assert_called_with(expected_fetch_url)
|
|
289
306
|
|
|
290
307
|
def test_fetch_merger_info(self) -> None:
|