kensho-kfinance 1.0.0__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.

Files changed (41) hide show
  1. kensho_kfinance-1.0.0/.coveragerc +22 -0
  2. kensho_kfinance-1.0.0/.github/workflows/ci-lint.yml +39 -0
  3. kensho_kfinance-1.0.0/.github/workflows/ci-test.yml +39 -0
  4. kensho_kfinance-1.0.0/.github/workflows/python-publish.yml +41 -0
  5. kensho_kfinance-1.0.0/.gitignore +100 -0
  6. kensho_kfinance-1.0.0/AUTHORS.md +9 -0
  7. kensho_kfinance-1.0.0/CODE_OF_CONDUCT.md +128 -0
  8. kensho_kfinance-1.0.0/CONTRIBUTING.md +13 -0
  9. kensho_kfinance-1.0.0/LICENSE +1 -0
  10. kensho_kfinance-1.0.0/PKG-INFO +53 -0
  11. kensho_kfinance-1.0.0/README.md +25 -0
  12. kensho_kfinance-1.0.0/docs/index.rst +9 -0
  13. kensho_kfinance-1.0.0/docs/kfinance.rst +5033 -0
  14. kensho_kfinance-1.0.0/docs/llm_tools.rst +191 -0
  15. kensho_kfinance-1.0.0/kensho_kfinance.egg-info/PKG-INFO +53 -0
  16. kensho_kfinance-1.0.0/kensho_kfinance.egg-info/SOURCES.txt +39 -0
  17. kensho_kfinance-1.0.0/kensho_kfinance.egg-info/dependency_links.txt +1 -0
  18. kensho_kfinance-1.0.0/kensho_kfinance.egg-info/requires.txt +17 -0
  19. kensho_kfinance-1.0.0/kensho_kfinance.egg-info/top_level.txt +1 -0
  20. kensho_kfinance-1.0.0/kfinance/CHANGELOG.md +10 -0
  21. kensho_kfinance-1.0.0/kfinance/__init__.py +0 -0
  22. kensho_kfinance-1.0.0/kfinance/constants.py +1689 -0
  23. kensho_kfinance-1.0.0/kfinance/fetch.py +374 -0
  24. kensho_kfinance-1.0.0/kfinance/kfinance.py +1224 -0
  25. kensho_kfinance-1.0.0/kfinance/llm_tools.py +688 -0
  26. kensho_kfinance-1.0.0/kfinance/meta_classes.py +367 -0
  27. kensho_kfinance-1.0.0/kfinance/prompt.py +526 -0
  28. kensho_kfinance-1.0.0/kfinance/py.typed +0 -0
  29. kensho_kfinance-1.0.0/kfinance/server_thread.py +62 -0
  30. kensho_kfinance-1.0.0/kfinance/tests/__init__.py +0 -0
  31. kensho_kfinance-1.0.0/kfinance/tests/test_fetch.py +241 -0
  32. kensho_kfinance-1.0.0/kfinance/tests/test_objects.py +551 -0
  33. kensho_kfinance-1.0.0/kfinance/tool_schemas.py +132 -0
  34. kensho_kfinance-1.0.0/kfinance/version.py +21 -0
  35. kensho_kfinance-1.0.0/pyproject.toml +130 -0
  36. kensho_kfinance-1.0.0/scripts/copyright_line_check.sh +48 -0
  37. kensho_kfinance-1.0.0/scripts/docs/make_rst.py +98 -0
  38. kensho_kfinance-1.0.0/scripts/lint.sh +19 -0
  39. kensho_kfinance-1.0.0/scripts/test.sh +5 -0
  40. kensho_kfinance-1.0.0/setup.cfg +4 -0
  41. kensho_kfinance-1.0.0/setup.py +4 -0
@@ -0,0 +1,22 @@
1
+ [run]
2
+ omit = tests/*
3
+ dynamic_context = test_function
4
+
5
+ [report]
6
+ # Regexes for lines to exclude from consideration
7
+ exclude_lines =
8
+ # Have to re-enable the standard pragma
9
+ pragma: no cover
10
+
11
+ # Don't complain about missing debug-only code
12
+ def __repr__
13
+
14
+ # Don't complain if tests don't hit defensive assertion code
15
+ raise AssertionError
16
+ raise NotImplementedError
17
+
18
+ # Don't complain if non-runnable code isn't run:
19
+ if __name__ == .__main__.:
20
+
21
+ # Don't complain if ellipsis never gets executed
22
+ ^[ ]*\.\.\.$
@@ -0,0 +1,39 @@
1
+ run-name: "Continuous Integration: Lint (on ${{ github.ref }})"
2
+ on:
3
+ pull_request:
4
+ branches:
5
+ - main
6
+
7
+ # Allows only one instance of this workflow to run for a ref
8
+ concurrency:
9
+ group: ${{ github.workflow }}-${{ github.ref }}
10
+ cancel-in-progress: true
11
+
12
+ # Since all our jobs run in a container, we must explicitly set the default
13
+ # shell, otherwise, Github Actions uses sh
14
+ defaults:
15
+ run:
16
+ shell: bash
17
+
18
+ jobs:
19
+ Lint:
20
+ runs-on: ubuntu-latest
21
+ strategy:
22
+ matrix:
23
+ python-version: [ '3.10', '3.11', '3.12' ]
24
+ steps:
25
+ - name: Checkout Repository
26
+ uses: actions/checkout@v4
27
+
28
+ - uses: actions/setup-python@v5
29
+ with:
30
+ python-version: ${{ matrix.python-version }}
31
+
32
+ - name: Install dependencies
33
+ run: |
34
+ python -m pip install --upgrade pip
35
+ pip install -e .[dev]
36
+ working-directory: ./
37
+
38
+ - name: Lint
39
+ run: ./scripts/lint.sh
@@ -0,0 +1,39 @@
1
+ run-name: "Continuous Integration: Test (on ${{ github.ref }})"
2
+ on:
3
+ pull_request:
4
+ branches:
5
+ - main
6
+
7
+ # Allows only one instance of this workflow to run for a ref
8
+ concurrency:
9
+ group: ${{ github.workflow }}-${{ github.ref }}
10
+ cancel-in-progress: true
11
+
12
+ # Since all our jobs run in a container, we must explicitly set the default
13
+ # shell, otherwise, Github Actions uses sh
14
+ defaults:
15
+ run:
16
+ shell: bash
17
+
18
+ jobs:
19
+ Test:
20
+ runs-on: ubuntu-latest
21
+ strategy:
22
+ matrix:
23
+ python-version: [ '3.10', '3.11', '3.12' ]
24
+ steps:
25
+ - name: Checkout Repository
26
+ uses: actions/checkout@v4
27
+
28
+ - uses: actions/setup-python@v5
29
+ with:
30
+ python-version: ${{ matrix.python-version }}
31
+
32
+ - name: Install dependencies
33
+ run: |
34
+ python -m pip install --upgrade pip
35
+ pip install -e .[dev]
36
+ working-directory: ./
37
+
38
+ - name: Test
39
+ run: ./scripts/test.sh
@@ -0,0 +1,41 @@
1
+ # This workflow will upload a Python Package using Twine when a release is created
2
+ # For more information see: https://docs.github.com/en/actions/automating-builds-and-tests/building-and-testing-python#publishing-to-package-registries
3
+
4
+ # This workflow uses actions that are not certified by GitHub.
5
+ # They are provided by a third-party and are governed by
6
+ # separate terms of service, privacy policy, and support
7
+ # documentation.
8
+
9
+ name: Upload Python Package
10
+
11
+ on:
12
+ release:
13
+ types: [published]
14
+
15
+ permissions:
16
+ contents: read
17
+
18
+ jobs:
19
+ pypi-publish:
20
+ name: upload release to PyPI
21
+ runs-on: ubuntu-latest
22
+ # Specifying a GitHub environment is optional, but strongly encouraged
23
+ environment: pypi
24
+ permissions:
25
+ # IMPORTANT: this permission is mandatory for Trusted Publishing
26
+ id-token: write
27
+
28
+ steps:
29
+ - uses: actions/checkout@v4
30
+ - name: Set up Python
31
+ uses: actions/setup-python@v3
32
+ with:
33
+ python-version: '3.x'
34
+ - name: Install dependencies
35
+ run: |
36
+ python -m pip install --upgrade pip
37
+ pip install build
38
+ - name: Build package
39
+ run: python -m build
40
+ - name: Publish package distributions to TestPyPI
41
+ uses: pypa/gh-action-pypi-publish@release/v1
@@ -0,0 +1,100 @@
1
+ # Byte-compiled / optimized / DLL files
2
+ __pycache__/
3
+ *.py[cod]
4
+ *$py.class
5
+
6
+ # Distribution / packaging
7
+ .Python
8
+ build/
9
+ develop-eggs/
10
+ dist/
11
+ downloads/
12
+ eggs/
13
+ .eggs/
14
+ lib/
15
+ lib64/
16
+ parts/
17
+ sdist/
18
+ var/
19
+ wheels/
20
+ share/python-wheels/
21
+ *.egg-info/
22
+ .installed.cfg
23
+ *.egg
24
+ MANIFEST
25
+
26
+ # PyInstaller
27
+ # Usually these files are written by a python script from a template
28
+ # before PyInstaller builds the exe, so as to inject date/other infos into it.
29
+ *.manifest
30
+ *.spec
31
+
32
+ # Installer logs
33
+ pip-log.txt
34
+ pip-delete-this-directory.txt
35
+
36
+ # Unit test / coverage reports
37
+ htmlcov/
38
+ .tox/
39
+ .nox/
40
+ .coverage
41
+ .coverage.*
42
+ .cache
43
+ nosetests.xml
44
+ coverage.xml
45
+ *.cover
46
+ *.py,cover
47
+ .hypothesis/
48
+ .pytest_cache/
49
+ cover/
50
+
51
+ # Translations
52
+ *.mo
53
+ *.pot
54
+
55
+ # Sphinx documentation
56
+ docs/_build/
57
+
58
+ # PyBuilder
59
+ .pybuilder/
60
+ target/
61
+
62
+ # Jupyter Notebook
63
+ .ipynb_checkpoints
64
+
65
+ # IPython
66
+ profile_default/
67
+ ipython_config.py
68
+
69
+ # Environments
70
+ .env
71
+ .venv
72
+ env/
73
+ venv/
74
+ ENV/
75
+ env.bak/
76
+ venv.bak/
77
+
78
+ # mypy
79
+ .mypy_cache/
80
+ .dmypy.json
81
+ dmypy.json
82
+
83
+ # Pyre type checker
84
+ .pyre/
85
+
86
+ # ruff
87
+ .ruff_cache/
88
+
89
+ # pytype static type analyzer
90
+ .pytype/
91
+
92
+ # Misc
93
+ .DS_Store
94
+
95
+ # any files generated by editors or IDEs
96
+ .idea
97
+ .idea/
98
+ .idea/*
99
+ .vscode/
100
+
@@ -0,0 +1,9 @@
1
+ Luke Brown
2
+
3
+ Michelle Keoy
4
+
5
+ Keith Page
6
+
7
+ Matthew Rosen
8
+
9
+ Nick Roshdieh
@@ -0,0 +1,128 @@
1
+ # Contributor Covenant Code of Conduct
2
+
3
+ ## Our Pledge
4
+
5
+ We as members, contributors, and leaders pledge to make participation in our
6
+ community a harassment-free experience for everyone, regardless of age, body
7
+ size, visible or invisible disability, ethnicity, sex characteristics, gender
8
+ identity and expression, level of experience, education, socio-economic status,
9
+ nationality, personal appearance, race, religion, or sexual identity
10
+ and orientation.
11
+
12
+ We pledge to act and interact in ways that contribute to an open, welcoming,
13
+ diverse, inclusive, and healthy community.
14
+
15
+ ## Our Standards
16
+
17
+ Examples of behavior that contributes to a positive environment for our
18
+ community include:
19
+
20
+ * Demonstrating empathy and kindness toward other people
21
+ * Being respectful of differing opinions, viewpoints, and experiences
22
+ * Giving and gracefully accepting constructive feedback
23
+ * Accepting responsibility and apologizing to those affected by our mistakes,
24
+ and learning from the experience
25
+ * Focusing on what is best not just for us as individuals, but for the
26
+ overall community
27
+
28
+ Examples of unacceptable behavior include:
29
+
30
+ * The use of sexualized language or imagery, and sexual attention or
31
+ advances of any kind
32
+ * Trolling, insulting or derogatory comments, and personal or political attacks
33
+ * Public or private harassment
34
+ * Publishing others' private information, such as a physical or email
35
+ address, without their explicit permission
36
+ * Other conduct which could reasonably be considered inappropriate in a
37
+ professional setting
38
+
39
+ ## Enforcement Responsibilities
40
+
41
+ Community leaders are responsible for clarifying and enforcing our standards of
42
+ acceptable behavior and will take appropriate and fair corrective action in
43
+ response to any behavior that they deem inappropriate, threatening, offensive,
44
+ or harmful.
45
+
46
+ Community leaders have the right and responsibility to remove, edit, or reject
47
+ comments, commits, code, wiki edits, issues, and other contributions that are
48
+ not aligned to this Code of Conduct, and will communicate reasons for moderation
49
+ decisions when appropriate.
50
+
51
+ ## Scope
52
+
53
+ This Code of Conduct applies within all community spaces, and also applies when
54
+ an individual is officially representing the community in public spaces.
55
+ Examples of representing our community include using an official e-mail address,
56
+ posting via an official social media account, or acting as an appointed
57
+ representative at an online or offline event.
58
+
59
+ ## Enforcement
60
+
61
+ Instances of abusive, harassing, or otherwise unacceptable behavior may be
62
+ reported to the community leaders responsible for enforcement at
63
+ [kFinance Maintainers](kfinance-maintainers@kensho.com).
64
+ All complaints will be reviewed and investigated promptly and fairly.
65
+
66
+ All community leaders are obligated to respect the privacy and security of the
67
+ reporter of any incident.
68
+
69
+ ## Enforcement Guidelines
70
+
71
+ Community leaders will follow these Community Impact Guidelines in determining
72
+ the consequences for any action they deem in violation of this Code of Conduct:
73
+
74
+ ### 1. Correction
75
+
76
+ **Community Impact**: Use of inappropriate language or other behavior deemed
77
+ unprofessional or unwelcome in the community.
78
+
79
+ **Consequence**: A private, written warning from community leaders, providing
80
+ clarity around the nature of the violation and an explanation of why the
81
+ behavior was inappropriate. A public apology may be requested.
82
+
83
+ ### 2. Warning
84
+
85
+ **Community Impact**: A violation through a single incident or series
86
+ of actions.
87
+
88
+ **Consequence**: A warning with consequences for continued behavior. No
89
+ interaction with the people involved, including unsolicited interaction with
90
+ those enforcing the Code of Conduct, for a specified period of time. This
91
+ includes avoiding interactions in community spaces as well as external channels
92
+ like social media. Violating these terms may lead to a temporary or
93
+ permanent ban.
94
+
95
+ ### 3. Temporary Ban
96
+
97
+ **Community Impact**: A serious violation of community standards, including
98
+ sustained inappropriate behavior.
99
+
100
+ **Consequence**: A temporary ban from any sort of interaction or public
101
+ communication with the community for a specified period of time. No public or
102
+ private interaction with the people involved, including unsolicited interaction
103
+ with those enforcing the Code of Conduct, is allowed during this period.
104
+ Violating these terms may lead to a permanent ban.
105
+
106
+ ### 4. Permanent Ban
107
+
108
+ **Community Impact**: Demonstrating a pattern of violation of community
109
+ standards, including sustained inappropriate behavior, harassment of an
110
+ individual, or aggression toward or disparagement of classes of individuals.
111
+
112
+ **Consequence**: A permanent ban from any sort of public interaction within
113
+ the community.
114
+
115
+ ## Attribution
116
+
117
+ This Code of Conduct is adapted from the [Contributor Covenant][homepage],
118
+ version 2.0, available at
119
+ https://www.contributor-covenant.org/version/2/0/code_of_conduct.html.
120
+
121
+ Community Impact Guidelines were inspired by [Mozilla's code of conduct
122
+ enforcement ladder](https://github.com/mozilla/diversity).
123
+
124
+ [homepage]: https://www.contributor-covenant.org
125
+
126
+ For answers to common questions about this code of conduct, see the FAQ at
127
+ https://www.contributor-covenant.org/faq. Translations are available at
128
+ https://www.contributor-covenant.org/translations.
@@ -0,0 +1,13 @@
1
+ # Contributing
2
+
3
+ Thank you for taking the time to contribute to this project!
4
+
5
+ ## Code of Conduct
6
+
7
+ This project adheres to the Contributor Covenant [code of conduct](CODE_OF_CONDUCT.md).
8
+ By participating, you are expected to uphold this code.
9
+ Please report unacceptable behavior to the [kFinance Maintainers](kfinance-maintainers@kensho.com).
10
+
11
+ ## Style Guide
12
+
13
+ https://google.github.io/styleguide/pyguide.html
@@ -0,0 +1 @@
1
+ Use is solely in accordance with the signed agreement between your entity and S&P.
@@ -0,0 +1,53 @@
1
+ Metadata-Version: 2.2
2
+ Name: kensho-kfinance
3
+ Version: 1.0.0
4
+ Summary: Python CLI for kFinance
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
+ Classifier: Programming Language :: Python :: 3
7
+ Classifier: Operating System :: OS Independent
8
+ Requires-Python: >=3.10
9
+ Description-Content-Type: text/markdown
10
+ License-File: LICENSE
11
+ License-File: AUTHORS.md
12
+ Requires-Dist: python-dateutil<2.9,>=2.8.2
13
+ Requires-Dist: requests<3,>=2.22.0
14
+ Requires-Dist: urllib3>=2.3.0
15
+ Requires-Dist: pyjwt>=2.8.0
16
+ Requires-Dist: numpy>=1.22.4
17
+ Requires-Dist: pandas>=2.0.0
18
+ Requires-Dist: types-requests<3,>=2.22.0
19
+ Requires-Dist: pillow>=10
20
+ Requires-Dist: langchain-core>=0.3.15
21
+ Requires-Dist: strenum>=0.4.15
22
+ Provides-Extra: dev
23
+ Requires-Dist: coverage<8,>=7.6.10; extra == "dev"
24
+ Requires-Dist: mypy<2,>=1.15.0; extra == "dev"
25
+ Requires-Dist: pytest<7,>=6.1.2; extra == "dev"
26
+ Requires-Dist: pytest-cov<7,>=6.0.0; extra == "dev"
27
+ Requires-Dist: ruff<1,>=0.9.4; extra == "dev"
28
+
29
+ # kFinance
30
+
31
+ The kFinance Python library provides a simple interface for the LLM-ready API, streamlining API requests and response handling. It can be used on its own, with LLMs, or integrated into applications.
32
+
33
+ For a complete overview of the functions, usage, and features of the kFinance Python library, please refer to documentation [here](https://kfinance.kensho.com/docs).
34
+
35
+ Any questions or suggestions can be sent to the [kFinance Maintainers](kfinance-maintainers@kensho.com).
36
+
37
+ # Setup
38
+
39
+ You can install kFinance on [PyPI](https://pypi.org/project/kfinance/) via
40
+
41
+ `pip install kfinance`
42
+
43
+ # Getting started
44
+
45
+ To receive access, please email [S&P Global Market Intelligence](market.intelligence@spglobal.com) for information on free trials and pricing.
46
+
47
+ Once access is obtained, get started using the [Authentication Guide](https://docs.kensho.com/llmreadyapi/kf-authentication) and [Usage Guide](https://docs.kensho.com/llmreadyapi/usage).
48
+
49
+ # License
50
+
51
+ Use is solely in accordance with the signed agreement between your entity and S&P.
52
+
53
+ Copyright 2025-present Kensho Technologies, LLC. The present date is determined by the timestamp of the most recent commit in the repository.
@@ -0,0 +1,25 @@
1
+ # kFinance
2
+
3
+ The kFinance Python library provides a simple interface for the LLM-ready API, streamlining API requests and response handling. It can be used on its own, with LLMs, or integrated into applications.
4
+
5
+ For a complete overview of the functions, usage, and features of the kFinance Python library, please refer to documentation [here](https://kfinance.kensho.com/docs).
6
+
7
+ Any questions or suggestions can be sent to the [kFinance Maintainers](kfinance-maintainers@kensho.com).
8
+
9
+ # Setup
10
+
11
+ You can install kFinance on [PyPI](https://pypi.org/project/kfinance/) via
12
+
13
+ `pip install kfinance`
14
+
15
+ # Getting started
16
+
17
+ To receive access, please email [S&P Global Market Intelligence](market.intelligence@spglobal.com) for information on free trials and pricing.
18
+
19
+ Once access is obtained, get started using the [Authentication Guide](https://docs.kensho.com/llmreadyapi/kf-authentication) and [Usage Guide](https://docs.kensho.com/llmreadyapi/usage).
20
+
21
+ # License
22
+
23
+ Use is solely in accordance with the signed agreement between your entity and S&P.
24
+
25
+ Copyright 2025-present Kensho Technologies, LLC. The present date is determined by the timestamp of the most recent commit in the repository.
@@ -0,0 +1,9 @@
1
+ Index
2
+ #####################
3
+
4
+ Documentation page for Kensho Finance library.
5
+
6
+ .. toctree::
7
+
8
+ kfinance
9
+ llm_tools