kensho-kfinance 1.1.0__tar.gz → 1.1.0a0__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-1.1.0a0/.readthedocs.yaml +21 -0
- {kensho_kfinance-1.1.0 → kensho_kfinance-1.1.0a0}/PKG-INFO +1 -1
- kensho_kfinance-1.1.0a0/docs/conf.py +66 -0
- kensho_kfinance-1.1.0a0/docs/index.rst +18 -0
- kensho_kfinance-1.1.0a0/docs/kfinance.rst +7 -0
- kensho_kfinance-1.1.0a0/docs/llm_tools.rst +7 -0
- kensho_kfinance-1.1.0a0/docs/requirements.txt +4 -0
- kensho_kfinance-1.1.0a0/docs/templates/apidoc/package.rst_t +50 -0
- kensho_kfinance-1.1.0a0/docs/templates/apidoc/toc.rst_t +10 -0
- {kensho_kfinance-1.1.0 → kensho_kfinance-1.1.0a0}/justfile +6 -0
- {kensho_kfinance-1.1.0 → kensho_kfinance-1.1.0a0}/kensho_kfinance.egg-info/PKG-INFO +1 -1
- {kensho_kfinance-1.1.0 → kensho_kfinance-1.1.0a0}/kensho_kfinance.egg-info/SOURCES.txt +6 -2
- {kensho_kfinance-1.1.0 → kensho_kfinance-1.1.0a0}/kfinance/llm_tools.py +24 -20
- {kensho_kfinance-1.1.0 → kensho_kfinance-1.1.0a0}/kfinance/tool_schemas.py +3 -1
- {kensho_kfinance-1.1.0 → kensho_kfinance-1.1.0a0}/kfinance/version.py +1 -1
- kensho_kfinance-1.1.0/docs/index.rst +0 -9
- kensho_kfinance-1.1.0/docs/kfinance.rst +0 -5033
- kensho_kfinance-1.1.0/docs/llm_tools.rst +0 -191
- kensho_kfinance-1.1.0/scripts/docs/make_rst.py +0 -98
- {kensho_kfinance-1.1.0 → kensho_kfinance-1.1.0a0}/.coveragerc +0 -0
- {kensho_kfinance-1.1.0 → kensho_kfinance-1.1.0a0}/.github/workflows/ci-lint.yml +0 -0
- {kensho_kfinance-1.1.0 → kensho_kfinance-1.1.0a0}/.github/workflows/ci-test.yml +0 -0
- {kensho_kfinance-1.1.0 → kensho_kfinance-1.1.0a0}/.github/workflows/python-publish.yml +0 -0
- {kensho_kfinance-1.1.0 → kensho_kfinance-1.1.0a0}/.gitignore +0 -0
- {kensho_kfinance-1.1.0 → kensho_kfinance-1.1.0a0}/AUTHORS.md +0 -0
- {kensho_kfinance-1.1.0 → kensho_kfinance-1.1.0a0}/CODE_OF_CONDUCT.md +0 -0
- {kensho_kfinance-1.1.0 → kensho_kfinance-1.1.0a0}/CONTRIBUTING.md +0 -0
- {kensho_kfinance-1.1.0 → kensho_kfinance-1.1.0a0}/LICENSE +0 -0
- {kensho_kfinance-1.1.0 → kensho_kfinance-1.1.0a0}/README.md +0 -0
- {kensho_kfinance-1.1.0 → kensho_kfinance-1.1.0a0}/kensho_kfinance.egg-info/dependency_links.txt +0 -0
- {kensho_kfinance-1.1.0 → kensho_kfinance-1.1.0a0}/kensho_kfinance.egg-info/requires.txt +0 -0
- {kensho_kfinance-1.1.0 → kensho_kfinance-1.1.0a0}/kensho_kfinance.egg-info/top_level.txt +0 -0
- {kensho_kfinance-1.1.0 → kensho_kfinance-1.1.0a0}/kfinance/CHANGELOG.md +0 -0
- {kensho_kfinance-1.1.0 → kensho_kfinance-1.1.0a0}/kfinance/__init__.py +0 -0
- {kensho_kfinance-1.1.0 → kensho_kfinance-1.1.0a0}/kfinance/constants.py +0 -0
- {kensho_kfinance-1.1.0 → kensho_kfinance-1.1.0a0}/kfinance/fetch.py +0 -0
- {kensho_kfinance-1.1.0 → kensho_kfinance-1.1.0a0}/kfinance/kfinance.py +0 -0
- {kensho_kfinance-1.1.0 → kensho_kfinance-1.1.0a0}/kfinance/meta_classes.py +0 -0
- {kensho_kfinance-1.1.0 → kensho_kfinance-1.1.0a0}/kfinance/prompt.py +0 -0
- {kensho_kfinance-1.1.0 → kensho_kfinance-1.1.0a0}/kfinance/py.typed +0 -0
- {kensho_kfinance-1.1.0 → kensho_kfinance-1.1.0a0}/kfinance/server_thread.py +0 -0
- {kensho_kfinance-1.1.0 → kensho_kfinance-1.1.0a0}/kfinance/tests/__init__.py +0 -0
- {kensho_kfinance-1.1.0 → kensho_kfinance-1.1.0a0}/kfinance/tests/test_fetch.py +0 -0
- {kensho_kfinance-1.1.0 → kensho_kfinance-1.1.0a0}/kfinance/tests/test_objects.py +0 -0
- {kensho_kfinance-1.1.0 → kensho_kfinance-1.1.0a0}/pyproject.toml +0 -0
- {kensho_kfinance-1.1.0 → kensho_kfinance-1.1.0a0}/scripts/copyright_line_check.sh +0 -0
- {kensho_kfinance-1.1.0 → kensho_kfinance-1.1.0a0}/scripts/lint.sh +0 -0
- {kensho_kfinance-1.1.0 → kensho_kfinance-1.1.0a0}/scripts/test.sh +0 -0
- {kensho_kfinance-1.1.0 → kensho_kfinance-1.1.0a0}/setup.cfg +0 -0
- {kensho_kfinance-1.1.0 → kensho_kfinance-1.1.0a0}/setup.py +0 -0
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
version: 2
|
|
2
|
+
build:
|
|
3
|
+
os: ubuntu-22.04
|
|
4
|
+
tools:
|
|
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
|
+
jobs:
|
|
11
|
+
pre_install:
|
|
12
|
+
- git update-index --assume-unchanged docs/conf.py
|
|
13
|
+
|
|
14
|
+
# Build documentation in the docs/ directory with Sphinx
|
|
15
|
+
sphinx:
|
|
16
|
+
configuration: docs/conf.py
|
|
17
|
+
|
|
18
|
+
# Dependencies required to build your docs
|
|
19
|
+
python:
|
|
20
|
+
install:
|
|
21
|
+
- requirements: docs/requirements.txt
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
Metadata-Version: 2.4
|
|
2
2
|
Name: kensho-kfinance
|
|
3
|
-
Version: 1.1.
|
|
3
|
+
Version: 1.1.0a0
|
|
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
|
|
@@ -0,0 +1,66 @@
|
|
|
1
|
+
# Configuration file for the Sphinx documentation builder.
|
|
2
|
+
#
|
|
3
|
+
# For the full list of built-in configuration values, see the documentation:
|
|
4
|
+
# https://www.sphinx-doc.org/en/master/usage/configuration.html
|
|
5
|
+
|
|
6
|
+
# -- Project information -----------------------------------------------------
|
|
7
|
+
# https://www.sphinx-doc.org/en/master/usage/configuration.html#project-information
|
|
8
|
+
from importlib.metadata import version as get_version
|
|
9
|
+
|
|
10
|
+
project = 'kensho-kfinance'
|
|
11
|
+
copyright = '2025, Kensho Technologies'
|
|
12
|
+
author = 'Kensho Technologies'
|
|
13
|
+
|
|
14
|
+
# borrowed from here:
|
|
15
|
+
# https://setuptools-scm.readthedocs.io/en/latest/usage/#usage-from-sphinx
|
|
16
|
+
release: str = get_version(project)
|
|
17
|
+
# for example take major/minor
|
|
18
|
+
version: str = ".".join(release.split('.')[:2])
|
|
19
|
+
|
|
20
|
+
# -- General configuration ---------------------------------------------------
|
|
21
|
+
# https://www.sphinx-doc.org/en/master/usage/configuration.html#general-configuration
|
|
22
|
+
|
|
23
|
+
# borrowed from internal Kensho Sphinx configuration
|
|
24
|
+
extensions = [
|
|
25
|
+
"sphinx.ext.autodoc",
|
|
26
|
+
"sphinx.ext.intersphinx",
|
|
27
|
+
"sphinx.ext.coverage",
|
|
28
|
+
"sphinx.ext.mathjax",
|
|
29
|
+
"sphinx.ext.githubpages",
|
|
30
|
+
"sphinx.ext.autosummary",
|
|
31
|
+
"sphinx.ext.viewcode",
|
|
32
|
+
"sphinx.ext.napoleon",
|
|
33
|
+
# 3rd party extensions
|
|
34
|
+
# m2r2 is to add support to .md files specifically to include README.md files.
|
|
35
|
+
# See this discussion: https://github.com/sphinx-doc/sphinx/issues/7000
|
|
36
|
+
"m2r2",
|
|
37
|
+
# A ReadTheDocs theme for Sphinx
|
|
38
|
+
"sphinx_rtd_theme",
|
|
39
|
+
]
|
|
40
|
+
|
|
41
|
+
napoleon_google_docstring = True
|
|
42
|
+
napoleon_use_ivar = True
|
|
43
|
+
|
|
44
|
+
autosummary_generate = True
|
|
45
|
+
|
|
46
|
+
# Don't prepend module path prefixes to function definitions. Makes automodule docs less cluttered
|
|
47
|
+
add_module_names = False
|
|
48
|
+
|
|
49
|
+
# Add any paths that contain templates here, relative to this directory.
|
|
50
|
+
templates_path = ["templates"]
|
|
51
|
+
|
|
52
|
+
# The suffix of source filenames.
|
|
53
|
+
source_suffix = [".rst", ".md"]
|
|
54
|
+
|
|
55
|
+
|
|
56
|
+
|
|
57
|
+
# -- Options for HTML output -------------------------------------------------
|
|
58
|
+
# https://www.sphinx-doc.org/en/master/usage/configuration.html#options-for-html-output
|
|
59
|
+
|
|
60
|
+
html_theme = 'sphinx_rtd_theme'
|
|
61
|
+
|
|
62
|
+
# https://sphinx-rtd-theme.readthedocs.io/en/stable/configuring.html
|
|
63
|
+
html_theme_options = {"body_min_width": 0, "body_max_width": "none"}
|
|
64
|
+
|
|
65
|
+
# https://www.sphinx-doc.org/en/1.4.9/config.html#confval-html_sidebars
|
|
66
|
+
html_sidebars = {"**": ["globaltoc.html", "relations.html", "searchbox.html"]}
|
|
@@ -0,0 +1,18 @@
|
|
|
1
|
+
Index
|
|
2
|
+
#####################
|
|
3
|
+
|
|
4
|
+
Documentation page for kensho-kfinance library.
|
|
5
|
+
|
|
6
|
+
.. toctree::
|
|
7
|
+
:hidden:
|
|
8
|
+
:glob:
|
|
9
|
+
:maxdepth: 1
|
|
10
|
+
|
|
11
|
+
kfinance <kfinance>
|
|
12
|
+
llm_tools <llm_tools>
|
|
13
|
+
|
|
14
|
+
Indices and tables
|
|
15
|
+
==================
|
|
16
|
+
|
|
17
|
+
* :ref:`genindex`
|
|
18
|
+
* :ref:`modindex`
|
|
@@ -0,0 +1,50 @@
|
|
|
1
|
+
{% raw %}
|
|
2
|
+
{%- macro automodule(modname, options) -%}
|
|
3
|
+
.. automodule:: {{ modname }}
|
|
4
|
+
{%- for option in options %}
|
|
5
|
+
:{{ option }}:
|
|
6
|
+
{%- endfor %}
|
|
7
|
+
{%- endmacro %}
|
|
8
|
+
|
|
9
|
+
{%- macro toctree(docnames) -%}
|
|
10
|
+
.. toctree::
|
|
11
|
+
:maxdepth: {{ maxdepth }}
|
|
12
|
+
{% for docname in docnames %}
|
|
13
|
+
{{ docname }}
|
|
14
|
+
{%- endfor %}
|
|
15
|
+
{%- endmacro %}
|
|
16
|
+
|
|
17
|
+
{%- if is_namespace %}
|
|
18
|
+
{{- [pkgname, "namespace"] | join(" ") | e | heading }}
|
|
19
|
+
{% else %}
|
|
20
|
+
{{- [pkgname] | join(" ") | e | heading }}
|
|
21
|
+
{% endif %}
|
|
22
|
+
|
|
23
|
+
{%- if modulefirst and not is_namespace %}
|
|
24
|
+
{{ automodule(pkgname, automodule_options) }}
|
|
25
|
+
{% endif %}
|
|
26
|
+
|
|
27
|
+
{%- if subpackages %}
|
|
28
|
+
{{ toctree(subpackages) }}
|
|
29
|
+
{% endif %}
|
|
30
|
+
|
|
31
|
+
{%- if submodules %}
|
|
32
|
+
{% if separatemodules %}
|
|
33
|
+
{{ toctree(submodules) }}
|
|
34
|
+
{% else %}
|
|
35
|
+
{%- for submodule in submodules %}
|
|
36
|
+
{% if show_headings %}
|
|
37
|
+
{{- [submodule] | join(" ") | e | heading(2) }}
|
|
38
|
+
{% endif %}
|
|
39
|
+
{{ automodule(submodule, automodule_options) }}
|
|
40
|
+
{% endfor %}
|
|
41
|
+
{%- endif %}
|
|
42
|
+
{%- endif %}
|
|
43
|
+
|
|
44
|
+
{%- if not modulefirst and not is_namespace %}
|
|
45
|
+
Module contents
|
|
46
|
+
---------------
|
|
47
|
+
|
|
48
|
+
{{ automodule(pkgname, automodule_options) }}
|
|
49
|
+
{% endif %}
|
|
50
|
+
{% endraw %}
|
|
@@ -29,3 +29,9 @@ alias t := unit-test
|
|
|
29
29
|
# Run unit tests. Use args for optional settings
|
|
30
30
|
unit-test *args:
|
|
31
31
|
python -m pytest {{args}}
|
|
32
|
+
|
|
33
|
+
# Build the sphinx documents locally
|
|
34
|
+
# First, copy the dependencies in docs/requirements.txt into pyproject.toml and install in a venv.
|
|
35
|
+
# Don't merge changes to pyproject and docs/output into the remote repo!
|
|
36
|
+
sphinx *args:
|
|
37
|
+
sphinx-build docs docs/output
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
Metadata-Version: 2.4
|
|
2
2
|
Name: kensho-kfinance
|
|
3
|
-
Version: 1.1.
|
|
3
|
+
Version: 1.1.0a0
|
|
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,6 @@
|
|
|
1
1
|
.coveragerc
|
|
2
2
|
.gitignore
|
|
3
|
+
.readthedocs.yaml
|
|
3
4
|
AUTHORS.md
|
|
4
5
|
CODE_OF_CONDUCT.md
|
|
5
6
|
CONTRIBUTING.md
|
|
@@ -11,9 +12,13 @@ setup.py
|
|
|
11
12
|
.github/workflows/ci-lint.yml
|
|
12
13
|
.github/workflows/ci-test.yml
|
|
13
14
|
.github/workflows/python-publish.yml
|
|
15
|
+
docs/conf.py
|
|
14
16
|
docs/index.rst
|
|
15
17
|
docs/kfinance.rst
|
|
16
18
|
docs/llm_tools.rst
|
|
19
|
+
docs/requirements.txt
|
|
20
|
+
docs/templates/apidoc/package.rst_t
|
|
21
|
+
docs/templates/apidoc/toc.rst_t
|
|
17
22
|
kensho_kfinance.egg-info/PKG-INFO
|
|
18
23
|
kensho_kfinance.egg-info/SOURCES.txt
|
|
19
24
|
kensho_kfinance.egg-info/dependency_links.txt
|
|
@@ -36,5 +41,4 @@ kfinance/tests/test_fetch.py
|
|
|
36
41
|
kfinance/tests/test_objects.py
|
|
37
42
|
scripts/copyright_line_check.sh
|
|
38
43
|
scripts/lint.sh
|
|
39
|
-
scripts/test.sh
|
|
40
|
-
scripts/docs/make_rst.py
|
|
44
|
+
scripts/test.sh
|
|
@@ -31,23 +31,25 @@ class Model(Enum):
|
|
|
31
31
|
|
|
32
32
|
|
|
33
33
|
def get_latest(use_local_timezone: bool = True) -> LatestPeriods:
|
|
34
|
-
"""Get the latest annual reporting year, latest quarterly reporting quarter and year, and current date.
|
|
34
|
+
"""Get the latest annual reporting year, latest quarterly reporting quarter and year, and current date.
|
|
35
35
|
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
"
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
"
|
|
47
|
-
|
|
48
|
-
|
|
36
|
+
The output is a dictionary with the following schema::
|
|
37
|
+
|
|
38
|
+
{
|
|
39
|
+
"annual": {
|
|
40
|
+
"latest_year": int
|
|
41
|
+
},
|
|
42
|
+
"quarterly": {
|
|
43
|
+
"latest_quarter": int,
|
|
44
|
+
"latest_year": int
|
|
45
|
+
},
|
|
46
|
+
"now": {
|
|
47
|
+
"current_year": int,
|
|
48
|
+
"current_quarter": int,
|
|
49
|
+
"current_month": int,
|
|
50
|
+
"current_date": str # in format Y-m-d
|
|
51
|
+
}
|
|
49
52
|
}
|
|
50
|
-
}
|
|
51
53
|
|
|
52
54
|
Args:
|
|
53
55
|
use_local_timezone: whether to use the local timezone of the user
|
|
@@ -86,12 +88,14 @@ def get_latest(use_local_timezone: bool = True) -> LatestPeriods:
|
|
|
86
88
|
|
|
87
89
|
|
|
88
90
|
def get_n_quarters_ago(n: int) -> YearAndQuarter:
|
|
89
|
-
"""Get the year and quarter corresponding to [n] quarters before the current quarter.
|
|
91
|
+
"""Get the year and quarter corresponding to [n] quarters before the current quarter.
|
|
90
92
|
|
|
91
|
-
|
|
92
|
-
|
|
93
|
-
|
|
94
|
-
|
|
93
|
+
The output is a dictionary with the following schema::
|
|
94
|
+
|
|
95
|
+
{
|
|
96
|
+
"year": int,
|
|
97
|
+
"quarter": int
|
|
98
|
+
}
|
|
95
99
|
|
|
96
100
|
Args:
|
|
97
101
|
n: number of quarters before the current quarter
|
|
@@ -16,7 +16,9 @@ class GetNQuartersAgoInput(BaseModel):
|
|
|
16
16
|
|
|
17
17
|
|
|
18
18
|
class GetCompanyIdFromIdentifier(BaseModel):
|
|
19
|
-
|
|
19
|
+
identifier: str = Field(
|
|
20
|
+
description="The identifier, which can be a ticker symbol, ISIN, or CUSIP"
|
|
21
|
+
)
|
|
20
22
|
|
|
21
23
|
|
|
22
24
|
class GetSecurityIdFromIdentifier(BaseModel):
|