kensho-kfinance 2.0.0__tar.gz → 2.0.1__tar.gz
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-2.0.0 → kensho_kfinance-2.0.1}/.readthedocs.yaml +6 -4
- {kensho_kfinance-2.0.0/kensho_kfinance.egg-info → kensho_kfinance-2.0.1}/PKG-INFO +1 -1
- {kensho_kfinance-2.0.0 → kensho_kfinance-2.0.1}/docs/build_tool_calling_documentation.py +7 -12
- {kensho_kfinance-2.0.0 → kensho_kfinance-2.0.1}/docs/conf.py +0 -6
- {kensho_kfinance-2.0.0 → kensho_kfinance-2.0.1/kensho_kfinance.egg-info}/PKG-INFO +1 -1
- {kensho_kfinance-2.0.0 → kensho_kfinance-2.0.1}/kfinance/CHANGELOG.md +3 -0
- {kensho_kfinance-2.0.0 → kensho_kfinance-2.0.1}/kfinance/version.py +2 -2
- {kensho_kfinance-2.0.0 → kensho_kfinance-2.0.1}/.coveragerc +0 -0
- {kensho_kfinance-2.0.0 → kensho_kfinance-2.0.1}/.github/workflows/ci-lint.yml +0 -0
- {kensho_kfinance-2.0.0 → kensho_kfinance-2.0.1}/.github/workflows/ci-test.yml +0 -0
- {kensho_kfinance-2.0.0 → kensho_kfinance-2.0.1}/.github/workflows/python-publish.yml +0 -0
- {kensho_kfinance-2.0.0 → kensho_kfinance-2.0.1}/.gitignore +0 -0
- {kensho_kfinance-2.0.0 → kensho_kfinance-2.0.1}/AUTHORS.md +0 -0
- {kensho_kfinance-2.0.0 → kensho_kfinance-2.0.1}/CODE_OF_CONDUCT.md +0 -0
- {kensho_kfinance-2.0.0 → kensho_kfinance-2.0.1}/CONTRIBUTING.md +0 -0
- {kensho_kfinance-2.0.0 → kensho_kfinance-2.0.1}/LICENSE +0 -0
- {kensho_kfinance-2.0.0 → kensho_kfinance-2.0.1}/README.md +0 -0
- {kensho_kfinance-2.0.0 → kensho_kfinance-2.0.1}/docs/index.rst +0 -0
- {kensho_kfinance-2.0.0 → kensho_kfinance-2.0.1}/docs/kfinance.rst +0 -0
- {kensho_kfinance-2.0.0 → kensho_kfinance-2.0.1}/docs/requirements.txt +0 -0
- {kensho_kfinance-2.0.0 → kensho_kfinance-2.0.1}/docs/templates/apidoc/package.rst_t +0 -0
- {kensho_kfinance-2.0.0 → kensho_kfinance-2.0.1}/docs/templates/apidoc/toc.rst_t +0 -0
- {kensho_kfinance-2.0.0 → kensho_kfinance-2.0.1}/docs/tool_calling.rst +0 -0
- {kensho_kfinance-2.0.0 → kensho_kfinance-2.0.1}/justfile +0 -0
- {kensho_kfinance-2.0.0 → kensho_kfinance-2.0.1}/kensho_kfinance.egg-info/SOURCES.txt +0 -0
- {kensho_kfinance-2.0.0 → kensho_kfinance-2.0.1}/kensho_kfinance.egg-info/dependency_links.txt +0 -0
- {kensho_kfinance-2.0.0 → kensho_kfinance-2.0.1}/kensho_kfinance.egg-info/requires.txt +0 -0
- {kensho_kfinance-2.0.0 → kensho_kfinance-2.0.1}/kensho_kfinance.egg-info/top_level.txt +0 -0
- {kensho_kfinance-2.0.0 → kensho_kfinance-2.0.1}/kfinance/__init__.py +0 -0
- {kensho_kfinance-2.0.0 → kensho_kfinance-2.0.1}/kfinance/batch_request_handling.py +0 -0
- {kensho_kfinance-2.0.0 → kensho_kfinance-2.0.1}/kfinance/constants.py +0 -0
- {kensho_kfinance-2.0.0 → kensho_kfinance-2.0.1}/kfinance/fetch.py +0 -0
- {kensho_kfinance-2.0.0 → kensho_kfinance-2.0.1}/kfinance/kfinance.py +0 -0
- {kensho_kfinance-2.0.0 → kensho_kfinance-2.0.1}/kfinance/meta_classes.py +0 -0
- {kensho_kfinance-2.0.0 → kensho_kfinance-2.0.1}/kfinance/prompt.py +0 -0
- {kensho_kfinance-2.0.0 → kensho_kfinance-2.0.1}/kfinance/py.typed +0 -0
- {kensho_kfinance-2.0.0 → kensho_kfinance-2.0.1}/kfinance/server_thread.py +0 -0
- {kensho_kfinance-2.0.0 → kensho_kfinance-2.0.1}/kfinance/tests/__init__.py +0 -0
- {kensho_kfinance-2.0.0 → kensho_kfinance-2.0.1}/kfinance/tests/test_batch_requests.py +0 -0
- {kensho_kfinance-2.0.0 → kensho_kfinance-2.0.1}/kfinance/tests/test_fetch.py +0 -0
- {kensho_kfinance-2.0.0 → kensho_kfinance-2.0.1}/kfinance/tests/test_objects.py +0 -0
- {kensho_kfinance-2.0.0 → kensho_kfinance-2.0.1}/kfinance/tests/test_tools.py +0 -0
- {kensho_kfinance-2.0.0 → kensho_kfinance-2.0.1}/kfinance/tool_calling/README.md +0 -0
- {kensho_kfinance-2.0.0 → kensho_kfinance-2.0.1}/kfinance/tool_calling/__init__.py +0 -0
- {kensho_kfinance-2.0.0 → kensho_kfinance-2.0.1}/kfinance/tool_calling/get_business_relationship_from_identifier.py +0 -0
- {kensho_kfinance-2.0.0 → kensho_kfinance-2.0.1}/kfinance/tool_calling/get_capitalization_from_identifier.py +0 -0
- {kensho_kfinance-2.0.0 → kensho_kfinance-2.0.1}/kfinance/tool_calling/get_company_id_from_identifier.py +0 -0
- {kensho_kfinance-2.0.0 → kensho_kfinance-2.0.1}/kfinance/tool_calling/get_cusip_from_ticker.py +0 -0
- {kensho_kfinance-2.0.0 → kensho_kfinance-2.0.1}/kfinance/tool_calling/get_earnings_call_datetimes_from_identifier.py +0 -0
- {kensho_kfinance-2.0.0 → kensho_kfinance-2.0.1}/kfinance/tool_calling/get_financial_line_item_from_identifier.py +0 -0
- {kensho_kfinance-2.0.0 → kensho_kfinance-2.0.1}/kfinance/tool_calling/get_financial_statement_from_identifier.py +0 -0
- {kensho_kfinance-2.0.0 → kensho_kfinance-2.0.1}/kfinance/tool_calling/get_history_metadata_from_identifier.py +0 -0
- {kensho_kfinance-2.0.0 → kensho_kfinance-2.0.1}/kfinance/tool_calling/get_info_from_identifier.py +0 -0
- {kensho_kfinance-2.0.0 → kensho_kfinance-2.0.1}/kfinance/tool_calling/get_isin_from_ticker.py +0 -0
- {kensho_kfinance-2.0.0 → kensho_kfinance-2.0.1}/kfinance/tool_calling/get_latest.py +0 -0
- {kensho_kfinance-2.0.0 → kensho_kfinance-2.0.1}/kfinance/tool_calling/get_n_quarters_ago.py +0 -0
- {kensho_kfinance-2.0.0 → kensho_kfinance-2.0.1}/kfinance/tool_calling/get_prices_from_identifier.py +0 -0
- {kensho_kfinance-2.0.0 → kensho_kfinance-2.0.1}/kfinance/tool_calling/get_security_id_from_identifier.py +0 -0
- {kensho_kfinance-2.0.0 → kensho_kfinance-2.0.1}/kfinance/tool_calling/get_trading_item_id_from_identifier.py +0 -0
- {kensho_kfinance-2.0.0 → kensho_kfinance-2.0.1}/kfinance/tool_calling/shared_models.py +0 -0
- {kensho_kfinance-2.0.0 → kensho_kfinance-2.0.1}/pyproject.toml +0 -0
- {kensho_kfinance-2.0.0 → kensho_kfinance-2.0.1}/scripts/copyright_line_check.sh +0 -0
- {kensho_kfinance-2.0.0 → kensho_kfinance-2.0.1}/scripts/lint.sh +0 -0
- {kensho_kfinance-2.0.0 → kensho_kfinance-2.0.1}/scripts/test.sh +0 -0
- {kensho_kfinance-2.0.0 → kensho_kfinance-2.0.1}/setup.cfg +0 -0
- {kensho_kfinance-2.0.0 → kensho_kfinance-2.0.1}/setup.py +0 -0
|
@@ -3,13 +3,15 @@ build:
|
|
|
3
3
|
os: ubuntu-22.04
|
|
4
4
|
tools:
|
|
5
5
|
python: "3.10"
|
|
6
|
-
# You can also specify other tool versions:
|
|
7
|
-
# nodejs: "16"
|
|
8
|
-
# borrowed from here:
|
|
9
|
-
# https://docs.readthedocs.com/platform/stable/build-customization.html#avoid-having-a-dirty-git-index
|
|
10
6
|
jobs:
|
|
11
7
|
pre_install:
|
|
8
|
+
# borrowed from here:
|
|
9
|
+
# https://docs.readthedocs.com/platform/stable/build-customization.html#avoid-having-a-dirty-git-index
|
|
12
10
|
- git update-index --assume-unchanged docs/conf.py
|
|
11
|
+
pre_build:
|
|
12
|
+
# build documentation for tool calling before generating docs.
|
|
13
|
+
- pip install langchain-core
|
|
14
|
+
- python docs/build_tool_calling_documentation.py
|
|
13
15
|
|
|
14
16
|
# Build documentation in the docs/ directory with Sphinx
|
|
15
17
|
sphinx:
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
Metadata-Version: 2.4
|
|
2
2
|
Name: kensho-kfinance
|
|
3
|
-
Version: 2.0.
|
|
3
|
+
Version: 2.0.1
|
|
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,5 +1,5 @@
|
|
|
1
|
-
import inspect
|
|
2
1
|
from enum import Enum
|
|
2
|
+
import inspect
|
|
3
3
|
from pathlib import Path
|
|
4
4
|
|
|
5
5
|
from langchain_core.utils.function_calling import convert_to_openai_tool
|
|
@@ -48,11 +48,7 @@ def add_function_to_tools_file(tool: KfinanceTool) -> None:
|
|
|
48
48
|
"""
|
|
49
49
|
|
|
50
50
|
# The signature built with the inspect module does not include necessary imports.
|
|
51
|
-
imports = [
|
|
52
|
-
"import kfinance",
|
|
53
|
-
"import datetime",
|
|
54
|
-
"from typing import Optional"
|
|
55
|
-
]
|
|
51
|
+
imports = ["import kfinance", "import datetime", "from typing import Optional"]
|
|
56
52
|
signature_str = build_signature_str(tool)
|
|
57
53
|
|
|
58
54
|
# Use inspect to retrieve the return type and add it to the imports if it's not a builtin.
|
|
@@ -66,10 +62,6 @@ def add_function_to_tools_file(tool: KfinanceTool) -> None:
|
|
|
66
62
|
for field_name, field_metadata in tool.args_schema.model_fields.items():
|
|
67
63
|
# We use the openai definition to extract the field description. This means that, just like
|
|
68
64
|
# pydantic/langchain, we use the docstring of an enum as the description for an enum field.
|
|
69
|
-
try:
|
|
70
|
-
openai_params[field_name]['description']
|
|
71
|
-
except:
|
|
72
|
-
assert False, tool.name
|
|
73
65
|
args += f"\n :param {field_name}: {openai_params[field_name]['description']}"
|
|
74
66
|
args += f"\n :type {field_name}: {display_as_type(field_metadata.annotation)}"
|
|
75
67
|
|
|
@@ -84,7 +76,8 @@ def add_function_to_tools_file(tool: KfinanceTool) -> None:
|
|
|
84
76
|
with open(inspect.getfile(tool.__class__), mode="a") as f:
|
|
85
77
|
f.write(func_str)
|
|
86
78
|
|
|
87
|
-
|
|
79
|
+
|
|
80
|
+
def build_signature_str(tool: KfinanceTool) -> str:
|
|
88
81
|
"""Return the signature string of the tool
|
|
89
82
|
|
|
90
83
|
Return value example:
|
|
@@ -104,7 +97,6 @@ def build_signature_str(tool) -> str:
|
|
|
104
97
|
return f"def {tool.name}{signature}:"
|
|
105
98
|
|
|
106
99
|
|
|
107
|
-
|
|
108
100
|
def add_module_to_tool_calling_rst(tool: KfinanceTool) -> None:
|
|
109
101
|
"""Add a module for each tool to tool_calling.rst.
|
|
110
102
|
|
|
@@ -121,3 +113,6 @@ def add_module_to_tool_calling_rst(tool: KfinanceTool) -> None:
|
|
|
121
113
|
|
|
122
114
|
with open(Path(Path(__file__).resolve().parent, "tool_calling.rst"), mode="a") as f:
|
|
123
115
|
f.write(module_str)
|
|
116
|
+
|
|
117
|
+
if __name__ == "__main__":
|
|
118
|
+
add_tool_calling_docs_for_all_tools()
|
|
@@ -7,15 +7,10 @@
|
|
|
7
7
|
# https://www.sphinx-doc.org/en/master/usage/configuration.html#project-information
|
|
8
8
|
from importlib.metadata import version as get_version
|
|
9
9
|
|
|
10
|
-
from docs.build_tool_calling_documentation import add_tool_calling_docs_for_all_tools
|
|
11
|
-
|
|
12
|
-
|
|
13
10
|
project = "kensho-kfinance"
|
|
14
11
|
copyright = "2025, Kensho Technologies"
|
|
15
12
|
author = "Kensho Technologies"
|
|
16
13
|
|
|
17
|
-
# Add documentation for tool calling.
|
|
18
|
-
add_tool_calling_docs_for_all_tools()
|
|
19
14
|
|
|
20
15
|
# borrowed from here:
|
|
21
16
|
# https://setuptools-scm.readthedocs.io/en/latest/usage/#usage-from-sphinx
|
|
@@ -59,7 +54,6 @@ templates_path = ["templates"]
|
|
|
59
54
|
source_suffix = [".rst", ".md"]
|
|
60
55
|
|
|
61
56
|
|
|
62
|
-
|
|
63
57
|
# -- Options for HTML output -------------------------------------------------
|
|
64
58
|
# https://www.sphinx-doc.org/en/master/usage/configuration.html#options-for-html-output
|
|
65
59
|
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
Metadata-Version: 2.4
|
|
2
2
|
Name: kensho-kfinance
|
|
3
|
-
Version: 2.0.
|
|
3
|
+
Version: 2.0.1
|
|
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
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
{kensho_kfinance-2.0.0 → kensho_kfinance-2.0.1}/kensho_kfinance.egg-info/dependency_links.txt
RENAMED
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
{kensho_kfinance-2.0.0 → kensho_kfinance-2.0.1}/kfinance/tool_calling/get_cusip_from_ticker.py
RENAMED
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
{kensho_kfinance-2.0.0 → kensho_kfinance-2.0.1}/kfinance/tool_calling/get_info_from_identifier.py
RENAMED
|
File without changes
|
{kensho_kfinance-2.0.0 → kensho_kfinance-2.0.1}/kfinance/tool_calling/get_isin_from_ticker.py
RENAMED
|
File without changes
|
|
File without changes
|
|
File without changes
|
{kensho_kfinance-2.0.0 → kensho_kfinance-2.0.1}/kfinance/tool_calling/get_prices_from_identifier.py
RENAMED
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|