kensho-kfinance 2.6.1__py3-none-any.whl → 2.6.2__py3-none-any.whl

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.

Potentially problematic release.


This version of kensho-kfinance might be problematic. Click here for more details.

@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.4
2
2
  Name: kensho-kfinance
3
- Version: 2.6.1
3
+ Version: 2.6.2
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
@@ -27,7 +27,7 @@ Requires-Dist: strenum>=0.4.15
27
27
  Requires-Dist: tabulate>=0.9.0
28
28
  Requires-Dist: types-requests<3,>=2.22.0
29
29
  Requires-Dist: requests<3,>=2.22.0
30
- Requires-Dist: urllib3>=1.21.1
30
+ Requires-Dist: urllib3>=2.5
31
31
  Provides-Extra: dev
32
32
  Requires-Dist: coverage<8,>=7.6.10; extra == "dev"
33
33
  Requires-Dist: ipykernel<7,>=6.29; extra == "dev"
@@ -67,11 +67,11 @@ Once access is obtained, get started using the [Authentication Guide](https://do
67
67
  To get started, we provide some notebooks:
68
68
 
69
69
  - The [LLM-ready API Basic Usage](example_notebooks%2Fbasic_usage.ipynb) notebook demonstrates how
70
- fetch data with the kFinance client.
70
+ fetch data with the kFinance client.
71
71
  - The [tool_calling notebooks](example_notebooks%2Ftool_calling) show how the kFinance library can
72
- be used for tool calling. We provide notebooks for OpenAI (GPT), Anthropic (Claude), and Google
72
+ be used for tool calling. We provide notebooks for OpenAI (GPT), Anthropic (Claude), and Google
73
73
  (Gemini). Each of these integrations comes in a langchain version, which uses langchain as a
74
- wrapper to simplify the integration, and as a lower level non-langchain version.
74
+ wrapper to simplify the integration, and as a lower level non-langchain version.
75
75
 
76
76
  We also provide an [interactive notebook](example_notebooks/basic_usage.ipynb) that demonstrates some usage examples.
77
77
 
@@ -88,15 +88,48 @@ The server's full signature is as follows:
88
88
  `kfinance.mcp [--stdio,-s]/[--sse, ] --refresh-token <refresh-token> --client-id <client-id> --private-key <private-key>`
89
89
 
90
90
  Authentication Methods (in order of precedence):
91
+
91
92
  1. Refresh Token: Uses an existing refresh token for authentication. The `--refresh-token <refresh-token>` argument must be provided.
92
93
  2. Key Pair: Uses client ID and private key for authentication. Both the `--client-id <client-id>` and `--private-key <private-key>` arguments must be provided.
93
94
  3. Browser: Falls back to browser-based authentication flow. This occurs if no auth arguments are provided.
94
95
 
95
96
  Transport Layers:
97
+
96
98
  - stdio can be set by passing either `--stdio` or `-s`
97
99
  - sse can be set by passing `--sse` or no other transport related flag
98
100
 
101
+ # Development
102
+
103
+ ## Working with Local Package Version
104
+
105
+ If you need to develop using a local version of the kFinance package in another project that uses [poetry](https://python-poetry.org/) for package and dependency management, follow these steps:
106
+
107
+ 1. In your dependent project's `pyproject.toml`, replace the kFinance package version specification:
108
+
109
+ ```toml
110
+ # Replace this:
111
+ # kensho-kfinance = "~2.0.1"
112
+ # With this:
113
+ kensho-kfinance = { path = "/absolute/path/to/kfinance", develop = true }
114
+ ```
115
+
116
+ The `develop = true` flag ensures that the package always matches your local version without requiring reinstallation after changes.
117
+
118
+ 2. Update your project's dependencies:
119
+
120
+ ```bash
121
+ poetry update # Update poetry.lock with new changes
122
+ poetry install # Install dependencies with updated configuration
123
+ ```
124
+
125
+ If you encounter the error "your pyproject.toml file has significantly changed", run:
126
+
127
+ ```bash
128
+ poetry lock # Sync the changes to poetry.lock
129
+ ```
130
+
99
131
  # Versioning
132
+
100
133
  The kFinance uses semantic versioning (major, minor, patch).
101
134
  To bump the version, add a new entry in [CHANGELOG.md](kfinance%2FCHANGELOG.md).
102
135
  This will generate a new version of the library as part of the release process.
@@ -1,18 +1,18 @@
1
- kensho_kfinance-2.6.1.dist-info/licenses/AUTHORS.md,sha256=0h9ClbI0pu1oKj1M28ROUsaxrbZg-6ukQGl6X4y9noI,68
2
- kensho_kfinance-2.6.1.dist-info/licenses/LICENSE,sha256=bsY4blvSgq6o0FMQ3RXa2NCgco--nHCCchLXzxr6kms,83
3
- kfinance/CHANGELOG.md,sha256=U74yQTIC0g8uDx0qjN-92xtYcHn0gEBu_bz9XvmgT7c,1817
1
+ kensho_kfinance-2.6.2.dist-info/licenses/AUTHORS.md,sha256=0h9ClbI0pu1oKj1M28ROUsaxrbZg-6ukQGl6X4y9noI,68
2
+ kensho_kfinance-2.6.2.dist-info/licenses/LICENSE,sha256=bsY4blvSgq6o0FMQ3RXa2NCgco--nHCCchLXzxr6kms,83
3
+ kfinance/CHANGELOG.md,sha256=ndCVbkomHlJ7kB7FoNB3N17A97hrPPtu02dxh-JBdJA,1927
4
4
  kfinance/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
5
5
  kfinance/batch_request_handling.py,sha256=G9rhpgQaCdb5C1dsfuJip8383iszibcOJ5k8gxld-tQ,5001
6
6
  kfinance/constants.py,sha256=jaHsTXEmGKLp55x1_ob_MA-GVn_hua5B6RZCbujKWz0,49401
7
7
  kfinance/fetch.py,sha256=QyQjL2t9Z_tT1DD_Xzal59URH7QtnrpLQywcHSFtoWA,26691
8
- kfinance/kfinance.py,sha256=tsrmprBmG8zsIJrvLv-j-c7xXtU64EWbIjKw4cQBaGw,72456
8
+ kfinance/kfinance.py,sha256=WNw6hR7eIKVFM5iBtGrArJcOowange_ed5_PAc0aLzE,72768
9
9
  kfinance/mcp.py,sha256=MbktclVfBOEwfe-eR7kPaTXopMJmn_8RMlf4Jx5CXKU,3689
10
10
  kfinance/meta_classes.py,sha256=bUkksl5a9NkQQWmSM2XIWP3jsmmP4ZAfvSxPW5tRZg4,21492
11
11
  kfinance/prompt.py,sha256=PtVB8c_FcSlVdyGgByAnIFGzuUuBaEjciCqnBJl1hSQ,25133
12
12
  kfinance/py.typed,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
13
13
  kfinance/pydantic_models.py,sha256=avpbPqwrAyLqsCbrmFpK_B8_fj1nPlBHrnPxRcBaSkE,774
14
14
  kfinance/server_thread.py,sha256=jUnt1YGoYDkqqz1MbCwd44zJs1T_Z2BCgvj75bdtLgA,2574
15
- kfinance/version.py,sha256=ZCGpbBiHct-cyiHhdogfnoocBa55-WdHLBG45JCVyVk,511
15
+ kfinance/version.py,sha256=0Bv8KyeMcw-iHj2UIKRw0oUzwjzKa7KzZIuWroBAK1A,511
16
16
  kfinance/tests/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
17
17
  kfinance/tests/conftest.py,sha256=dhL_RSc-af3j-2_UrAGRE9mxgcbjuIRtj08DTx79pQc,1123
18
18
  kfinance/tests/scratch.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
@@ -38,7 +38,7 @@ kfinance/tool_calling/get_info_from_identifier.py,sha256=PRhSYpYs_iUcIVFGYCMN_7Q
38
38
  kfinance/tool_calling/get_isin_from_ticker.py,sha256=2fJBcA-rNGbVOQmQ7qJEYxqejQwJ6nyWOBSFlzxG7dY,638
39
39
  kfinance/tool_calling/get_latest.py,sha256=btGeVBmvX5QJutzrKfE6spatGGejDuHxtq53NoAaGNk,786
40
40
  kfinance/tool_calling/get_latest_earnings.py,sha256=pQdExGdztGY3pHcak0bd6ULNf_ROPc91bJ7zAVSKQkk,1117
41
- kfinance/tool_calling/get_merger_info_from_transaction_id.py,sha256=PodFtnY1_sRXcp51mBobQTqj__GMRbbMxgoRIhPBArA,2938
41
+ kfinance/tool_calling/get_merger_info_from_transaction_id.py,sha256=8aMktxIs89czDRCn4o7LcUmoTO8ueUDI40nXHo6rNZY,3142
42
42
  kfinance/tool_calling/get_mergers_from_identifier.py,sha256=9tCaSrJsK3-i0ZDNKAJRhE-nRdJvQxTbrZbvVY0YmQw,1702
43
43
  kfinance/tool_calling/get_n_quarters_ago.py,sha256=A0ilwPKUqU0YYQSz3gNsVF0Jy4YttXrSaDhYj7y8GHA,713
44
44
  kfinance/tool_calling/get_next_earnings.py,sha256=knzQw-m-hscCvTuDUXG9v_dObKJBGn5BbDZWGKHKQcw,1097
@@ -48,7 +48,7 @@ kfinance/tool_calling/get_transcript.py,sha256=eB-IsRwD-mllsMOYRZbH35caQ1Y3teKft
48
48
  kfinance/tool_calling/prompts.py,sha256=Yw1DJIMh90cjL-8q6_RMRiSjCtFDXvJAy7QiV5_uAU8,911
49
49
  kfinance/tool_calling/resolve_identifier.py,sha256=npslr6bBCu0qEDV1-8d24F5OC3nQ1KBMphuMbHVC1AU,626
50
50
  kfinance/tool_calling/shared_models.py,sha256=loNoVFVyQnnpHLUIjkR6P9flGNbzp6kkGpL5hT37Sdg,2666
51
- kensho_kfinance-2.6.1.dist-info/METADATA,sha256=OLtcQoyXfVs3KjB1RSZu4kNYktKoKqGV8qLJBfZKTiA,5191
52
- kensho_kfinance-2.6.1.dist-info/WHEEL,sha256=_zCd3N1l69ArxyTb8rzEoP9TpbYXkqRFSNOD5OuxnTs,91
53
- kensho_kfinance-2.6.1.dist-info/top_level.txt,sha256=kT_kNwVhfQoOAecY8W7uYah5xaHMoHoAdBIvXh6DaKM,9
54
- kensho_kfinance-2.6.1.dist-info/RECORD,,
51
+ kensho_kfinance-2.6.2.dist-info/METADATA,sha256=gmrV13LppEUpW6KMJKZftWQz1UlN165RC-G5Uwpxts8,6197
52
+ kensho_kfinance-2.6.2.dist-info/WHEEL,sha256=_zCd3N1l69ArxyTb8rzEoP9TpbYXkqRFSNOD5OuxnTs,91
53
+ kensho_kfinance-2.6.2.dist-info/top_level.txt,sha256=kT_kNwVhfQoOAecY8W7uYah5xaHMoHoAdBIvXh6DaKM,9
54
+ kensho_kfinance-2.6.2.dist-info/RECORD,,
kfinance/CHANGELOG.md CHANGED
@@ -1,5 +1,11 @@
1
1
  # Changelog
2
2
 
3
+ # v2.6.3
4
+ - Bump urllib3 to 2.5 to address CVEs
5
+
6
+ ## v2.6.2
7
+ - Safely check for incomplete merger information
8
+
3
9
  ## v2.6.1
4
10
  - Remove get_earnings_call_datetimes_from_identifier tool
5
11
 
kfinance/kfinance.py CHANGED
@@ -1279,11 +1279,17 @@ class MergerOrAcquisition:
1279
1279
  """Property for the combined information in the merger."""
1280
1280
  if not self._merger_info:
1281
1281
  self._merger_info = self.kfinance_api_client.fetch_merger_info(self.transaction_id)
1282
- timeline = pd.DataFrame(self.merger_info["timeline"])
1283
- timeline["date"] = pd.to_datetime(timeline["date"])
1284
- self._merger_info["timeline"] = timeline
1285
- details = pd.DataFrame(self.merger_info["consideration"]["details"])
1286
- self._merger_info["consideration"]["details"] = details
1282
+ if "timeline" in self._merger_info and self._merger_info["timeline"]:
1283
+ timeline = pd.DataFrame(self._merger_info["timeline"])
1284
+ timeline["date"] = pd.to_datetime(timeline["date"])
1285
+ self._merger_info["timeline"] = timeline
1286
+ if (
1287
+ "consideration" in self._merger_info
1288
+ and self._merger_info["consideration"]
1289
+ and "details" in self._merger_info["consideration"]
1290
+ ):
1291
+ details = pd.DataFrame(self._merger_info["consideration"]["details"])
1292
+ self._merger_info["consideration"]["details"] = details
1287
1293
  return self._merger_info
1288
1294
 
1289
1295
  @property
@@ -31,7 +31,9 @@ class GetMergerInfoFromTransactionId(KfinanceTool):
31
31
  "timeline": [
32
32
  {"status": timeline["status"], "date": timeline["date"].strftime("%Y-%m-%d")}
33
33
  for timeline in merger_timeline.to_dict(orient="records")
34
- ],
34
+ ]
35
+ if merger_timeline is not None
36
+ else None,
35
37
  "participants": {
36
38
  "target": {
37
39
  "company_id": merger_participants["target"].company_id,
@@ -45,7 +47,9 @@ class GetMergerInfoFromTransactionId(KfinanceTool):
45
47
  {"company_id": seller.company_id, "company_name": seller.name}
46
48
  for seller in merger_participants["sellers"]
47
49
  ],
48
- },
50
+ }
51
+ if merger_participants is not None
52
+ else None,
49
53
  "consideration": {
50
54
  "currency_name": merger_consideration["currency_name"],
51
55
  "current_calculated_gross_total_transaction_value": merger_consideration[
@@ -58,5 +62,7 @@ class GetMergerInfoFromTransactionId(KfinanceTool):
58
62
  "current_calculated_implied_enterprise_value"
59
63
  ],
60
64
  "details": merger_consideration["details"].to_dict(orient="records"),
61
- },
65
+ }
66
+ if merger_consideration is not None
67
+ else None,
62
68
  }
kfinance/version.py CHANGED
@@ -17,5 +17,5 @@ __version__: str
17
17
  __version_tuple__: VERSION_TUPLE
18
18
  version_tuple: VERSION_TUPLE
19
19
 
20
- __version__ = version = '2.6.1'
21
- __version_tuple__ = version_tuple = (2, 6, 1)
20
+ __version__ = version = '2.6.2'
21
+ __version_tuple__ = version_tuple = (2, 6, 2)