pycode-kg 0.21.0__tar.gz → 0.21.2__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.
Files changed (62) hide show
  1. {pycode_kg-0.21.0 → pycode_kg-0.21.2}/PKG-INFO +6 -6
  2. {pycode_kg-0.21.0 → pycode_kg-0.21.2}/README.md +4 -4
  3. {pycode_kg-0.21.0 → pycode_kg-0.21.2}/pyproject.toml +11 -6
  4. {pycode_kg-0.21.0 → pycode_kg-0.21.2}/src/pycode_kg/__init__.py +1 -1
  5. {pycode_kg-0.21.0 → pycode_kg-0.21.2}/src/pycode_kg/analysis/bridge.py +1 -1
  6. {pycode_kg-0.21.0 → pycode_kg-0.21.2}/src/pycode_kg/analysis/centrality.py +1 -1
  7. {pycode_kg-0.21.0 → pycode_kg-0.21.2}/src/pycode_kg/analysis/framework_detector.py +1 -1
  8. {pycode_kg-0.21.0 → pycode_kg-0.21.2}/src/pycode_kg/cli/cmd_hooks.py +31 -15
  9. {pycode_kg-0.21.0 → pycode_kg-0.21.2}/src/pycode_kg/pycodekg.py +1 -1
  10. {pycode_kg-0.21.0 → pycode_kg-0.21.2}/src/pycode_kg/snapshots.py +1 -1
  11. {pycode_kg-0.21.0 → pycode_kg-0.21.2}/LICENSE +0 -0
  12. {pycode_kg-0.21.0 → pycode_kg-0.21.2}/src/pycode_kg/.DS_Store +0 -0
  13. {pycode_kg-0.21.0 → pycode_kg-0.21.2}/src/pycode_kg/__main__.py +0 -0
  14. {pycode_kg-0.21.0 → pycode_kg-0.21.2}/src/pycode_kg/analysis/__init__.py +0 -0
  15. {pycode_kg-0.21.0 → pycode_kg-0.21.2}/src/pycode_kg/analysis/hybrid_rank.py +0 -0
  16. {pycode_kg-0.21.0 → pycode_kg-0.21.2}/src/pycode_kg/app.py +0 -0
  17. {pycode_kg-0.21.0 → pycode_kg-0.21.2}/src/pycode_kg/architecture.py +0 -0
  18. {pycode_kg-0.21.0 → pycode_kg-0.21.2}/src/pycode_kg/build_pycodekg_sqlite.py +0 -0
  19. {pycode_kg-0.21.0 → pycode_kg-0.21.2}/src/pycode_kg/cli/__init__.py +0 -0
  20. {pycode_kg-0.21.0 → pycode_kg-0.21.2}/src/pycode_kg/cli/cmd_analyze.py +0 -0
  21. {pycode_kg-0.21.0 → pycode_kg-0.21.2}/src/pycode_kg/cli/cmd_architecture.py +0 -0
  22. {pycode_kg-0.21.0 → pycode_kg-0.21.2}/src/pycode_kg/cli/cmd_bridges.py +0 -0
  23. {pycode_kg-0.21.0 → pycode_kg-0.21.2}/src/pycode_kg/cli/cmd_build.py +0 -0
  24. {pycode_kg-0.21.0 → pycode_kg-0.21.2}/src/pycode_kg/cli/cmd_build_full.py +0 -0
  25. {pycode_kg-0.21.0 → pycode_kg-0.21.2}/src/pycode_kg/cli/cmd_centrality.py +0 -0
  26. {pycode_kg-0.21.0 → pycode_kg-0.21.2}/src/pycode_kg/cli/cmd_explain.py +0 -0
  27. {pycode_kg-0.21.0 → pycode_kg-0.21.2}/src/pycode_kg/cli/cmd_framework_nodes.py +0 -0
  28. {pycode_kg-0.21.0 → pycode_kg-0.21.2}/src/pycode_kg/cli/cmd_init.py +0 -0
  29. {pycode_kg-0.21.0 → pycode_kg-0.21.2}/src/pycode_kg/cli/cmd_mcp.py +0 -0
  30. {pycode_kg-0.21.0 → pycode_kg-0.21.2}/src/pycode_kg/cli/cmd_model.py +0 -0
  31. {pycode_kg-0.21.0 → pycode_kg-0.21.2}/src/pycode_kg/cli/cmd_query.py +0 -0
  32. {pycode_kg-0.21.0 → pycode_kg-0.21.2}/src/pycode_kg/cli/cmd_snapshot.py +0 -0
  33. {pycode_kg-0.21.0 → pycode_kg-0.21.2}/src/pycode_kg/cli/cmd_viz.py +0 -0
  34. {pycode_kg-0.21.0 → pycode_kg-0.21.2}/src/pycode_kg/cli/main.py +0 -0
  35. {pycode_kg-0.21.0 → pycode_kg-0.21.2}/src/pycode_kg/cli/options.py +0 -0
  36. {pycode_kg-0.21.0 → pycode_kg-0.21.2}/src/pycode_kg/config.py +0 -0
  37. {pycode_kg-0.21.0 → pycode_kg-0.21.2}/src/pycode_kg/explain.py +0 -0
  38. {pycode_kg-0.21.0 → pycode_kg-0.21.2}/src/pycode_kg/graph.py +0 -0
  39. {pycode_kg-0.21.0 → pycode_kg-0.21.2}/src/pycode_kg/graph_html.py +0 -0
  40. {pycode_kg-0.21.0 → pycode_kg-0.21.2}/src/pycode_kg/index.py +0 -0
  41. {pycode_kg-0.21.0 → pycode_kg-0.21.2}/src/pycode_kg/kg.py +0 -0
  42. {pycode_kg-0.21.0 → pycode_kg-0.21.2}/src/pycode_kg/layout3d.py +0 -0
  43. {pycode_kg-0.21.0 → pycode_kg-0.21.2}/src/pycode_kg/mcp_server.py +0 -0
  44. {pycode_kg-0.21.0 → pycode_kg-0.21.2}/src/pycode_kg/module/__init__.py +0 -0
  45. {pycode_kg-0.21.0 → pycode_kg-0.21.2}/src/pycode_kg/module/base.py +0 -0
  46. {pycode_kg-0.21.0 → pycode_kg-0.21.2}/src/pycode_kg/module/extractor.py +0 -0
  47. {pycode_kg-0.21.0 → pycode_kg-0.21.2}/src/pycode_kg/module/types.py +0 -0
  48. {pycode_kg-0.21.0 → pycode_kg-0.21.2}/src/pycode_kg/pycodekg_query.py +0 -0
  49. {pycode_kg-0.21.0 → pycode_kg-0.21.2}/src/pycode_kg/pycodekg_snippet_packer.py +0 -0
  50. {pycode_kg-0.21.0 → pycode_kg-0.21.2}/src/pycode_kg/pycodekg_thorough_analysis.py +0 -0
  51. {pycode_kg-0.21.0 → pycode_kg-0.21.2}/src/pycode_kg/pycodekg_viz.py +0 -0
  52. {pycode_kg-0.21.0 → pycode_kg-0.21.2}/src/pycode_kg/pycodekg_viz3d.py +0 -0
  53. {pycode_kg-0.21.0 → pycode_kg-0.21.2}/src/pycode_kg/ranking/__init__.py +0 -0
  54. {pycode_kg-0.21.0 → pycode_kg-0.21.2}/src/pycode_kg/ranking/cli_rank.py +0 -0
  55. {pycode_kg-0.21.0 → pycode_kg-0.21.2}/src/pycode_kg/ranking/coderank.py +0 -0
  56. {pycode_kg-0.21.0 → pycode_kg-0.21.2}/src/pycode_kg/sql/004_add_centrality_table.sql +0 -0
  57. {pycode_kg-0.21.0 → pycode_kg-0.21.2}/src/pycode_kg/store.py +0 -0
  58. {pycode_kg-0.21.0 → pycode_kg-0.21.2}/src/pycode_kg/theme.py +0 -0
  59. {pycode_kg-0.21.0 → pycode_kg-0.21.2}/src/pycode_kg/utils.py +0 -0
  60. {pycode_kg-0.21.0 → pycode_kg-0.21.2}/src/pycode_kg/visitor.py +0 -0
  61. {pycode_kg-0.21.0 → pycode_kg-0.21.2}/src/pycode_kg/viz3d.py +0 -0
  62. {pycode_kg-0.21.0 → pycode_kg-0.21.2}/src/pycode_kg/viz3d_timeline.py +0 -0
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.4
2
2
  Name: pycode-kg
3
- Version: 0.21.0
3
+ Version: 0.21.2
4
4
  Summary: A tool to build a searchable knowledge graph from Python repositories
5
5
  License-Expression: Elastic-2.0
6
6
  License-File: LICENSE
@@ -27,7 +27,7 @@ Requires-Dist: detect-secrets (>=1.5.0) ; extra == "dev"
27
27
  Requires-Dist: kgmodule-utils[semantic,sqlite-vec,viz] (>=0.9.0)
28
28
  Requires-Dist: markdown (>=3.6) ; extra == "all"
29
29
  Requires-Dist: markdown (>=3.6) ; extra == "viz3d"
30
- Requires-Dist: mcp (>=1.0.0)
30
+ Requires-Dist: mcp (>=1.0.0,<2)
31
31
  Requires-Dist: networkx (>=3.0)
32
32
  Requires-Dist: numpy (>=1.24.0)
33
33
  Requires-Dist: pandas (>=2.0.0)
@@ -73,7 +73,7 @@ Description-Content-Type: text/markdown
73
73
 
74
74
  [![Python](https://img.shields.io/badge/python-3.12%20%7C%203.13-blue.svg)](https://www.python.org/)
75
75
  [![License: Elastic-2.0](https://img.shields.io/badge/License-Elastic%202.0-blue.svg)](https://www.elastic.co/licensing/elastic-license)
76
- [![Version](https://img.shields.io/badge/version-0.21.0-blue.svg)](https://github.com/Flux-Frontiers/pycode_kg/releases)
76
+ [![Version](https://img.shields.io/badge/version-0.21.2-blue.svg)](https://github.com/Flux-Frontiers/pycode_kg/releases)
77
77
  [![CI](https://github.com/Flux-Frontiers/pycode_kg/actions/workflows/ci.yml/badge.svg)](https://github.com/Flux-Frontiers/pycode_kg/actions/workflows/ci.yml)
78
78
  [![Poetry](https://img.shields.io/endpoint?url=https://python-poetry.org/badge/v0.json)](https://python-poetry.org/)
79
79
  [![DOI](https://zenodo.org/badge/1202379010.svg)](https://zenodo.org/badge/latestdoi/1202379010)
@@ -270,13 +270,13 @@ If you use PyCodeKG in your research or project, please cite it:
270
270
 
271
271
  [![DOI](https://zenodo.org/badge/1202379010.svg)](https://zenodo.org/badge/latestdoi/1202379010)
272
272
 
273
- > Suchanek, E. G. (2026). *PyCodeKG: A Knowledge Graph for Python Codebases* (Version 0.21.0) [Software]. Flux-Frontiers. https://doi.org/10.5281/zenodo.19834777
273
+ > Suchanek, E. G. (2026). *PyCodeKG: A Knowledge Graph for Python Codebases* (Version 0.21.2) [Software]. Flux-Frontiers. https://doi.org/10.5281/zenodo.19834777
274
274
 
275
275
  ```bibtex
276
276
  @software{suchanek_pycode_kg,
277
277
  author = {Suchanek, Eric G.},
278
278
  title = {{PyCodeKG}: A Knowledge Graph for Python Codebases},
279
- version = {0.21.0},
279
+ version = {0.21.2},
280
280
  year = {2026},
281
281
  publisher = {Flux-Frontiers},
282
282
  url = {https://github.com/Flux-Frontiers/pycode_kg},
@@ -300,5 +300,5 @@ If you use PyCodeKG in your research or project, please cite it:
300
300
 
301
301
  ---
302
302
 
303
- *Built for Python developers and AI agents that work alongside them — egs · Last updated May 2026*
303
+ *Built for Python developers and AI agents that work alongside them — egs · Last updated July 2026*
304
304
 
@@ -5,7 +5,7 @@
5
5
 
6
6
  [![Python](https://img.shields.io/badge/python-3.12%20%7C%203.13-blue.svg)](https://www.python.org/)
7
7
  [![License: Elastic-2.0](https://img.shields.io/badge/License-Elastic%202.0-blue.svg)](https://www.elastic.co/licensing/elastic-license)
8
- [![Version](https://img.shields.io/badge/version-0.21.0-blue.svg)](https://github.com/Flux-Frontiers/pycode_kg/releases)
8
+ [![Version](https://img.shields.io/badge/version-0.21.2-blue.svg)](https://github.com/Flux-Frontiers/pycode_kg/releases)
9
9
  [![CI](https://github.com/Flux-Frontiers/pycode_kg/actions/workflows/ci.yml/badge.svg)](https://github.com/Flux-Frontiers/pycode_kg/actions/workflows/ci.yml)
10
10
  [![Poetry](https://img.shields.io/endpoint?url=https://python-poetry.org/badge/v0.json)](https://python-poetry.org/)
11
11
  [![DOI](https://zenodo.org/badge/1202379010.svg)](https://zenodo.org/badge/latestdoi/1202379010)
@@ -202,13 +202,13 @@ If you use PyCodeKG in your research or project, please cite it:
202
202
 
203
203
  [![DOI](https://zenodo.org/badge/1202379010.svg)](https://zenodo.org/badge/latestdoi/1202379010)
204
204
 
205
- > Suchanek, E. G. (2026). *PyCodeKG: A Knowledge Graph for Python Codebases* (Version 0.21.0) [Software]. Flux-Frontiers. https://doi.org/10.5281/zenodo.19834777
205
+ > Suchanek, E. G. (2026). *PyCodeKG: A Knowledge Graph for Python Codebases* (Version 0.21.2) [Software]. Flux-Frontiers. https://doi.org/10.5281/zenodo.19834777
206
206
 
207
207
  ```bibtex
208
208
  @software{suchanek_pycode_kg,
209
209
  author = {Suchanek, Eric G.},
210
210
  title = {{PyCodeKG}: A Knowledge Graph for Python Codebases},
211
- version = {0.21.0},
211
+ version = {0.21.2},
212
212
  year = {2026},
213
213
  publisher = {Flux-Frontiers},
214
214
  url = {https://github.com/Flux-Frontiers/pycode_kg},
@@ -232,4 +232,4 @@ If you use PyCodeKG in your research or project, please cite it:
232
232
 
233
233
  ---
234
234
 
235
- *Built for Python developers and AI agents that work alongside them — egs · Last updated May 2026*
235
+ *Built for Python developers and AI agents that work alongside them — egs · Last updated July 2026*
@@ -1,7 +1,7 @@
1
1
  # pyproject.toml — PyCodeKG package configuration (PEP 621)
2
2
  #
3
3
  # Author: Eric G. Suchanek, PhD
4
- # Last Revision: 2026-07-28
4
+ # Last Revision: 2026-07-29
5
5
  #
6
6
  # Build system : Poetry 2.x with PEP 621 [project] table
7
7
  #
@@ -70,7 +70,7 @@ torch = [
70
70
  # ---------------------------------------------------------------------------
71
71
  [project]
72
72
  name = "pycode-kg"
73
- version = "0.21.0"
73
+ version = "0.21.2"
74
74
  description = "A tool to build a searchable knowledge graph from Python repositories"
75
75
  readme = "README.md"
76
76
  license = "Elastic-2.0"
@@ -90,7 +90,13 @@ classifiers = [
90
90
  requires-python = ">=3.12,<3.14"
91
91
  dependencies = [
92
92
  "click>=8.1.0,<9",
93
- "mcp>=1.0.0",
93
+ # Upper-bounded: mcp 2.0 removed the bundled `mcp.server.fastmcp` module
94
+ # (FastMCP was split out into the standalone `fastmcp` package) and rebuilt
95
+ # mcp.server around new submodules. src/pycode_kg/mcp_server.py imports
96
+ # FastMCP from mcp, so an unbounded floor lets a clean install pull 2.x and
97
+ # break `pycodekg-mcp` at import time. Lift this only alongside a port to
98
+ # the standalone fastmcp package.
99
+ "mcp>=1.0.0,<2",
94
100
  "networkx>=3.0",
95
101
  "numpy>=1.24.0",
96
102
  "pandas>=2.0.0",
@@ -131,9 +137,8 @@ viz3d = [
131
137
  # forces poetry's universal resolution to reconcile the transformers pin of
132
138
  # every *published* sibling against this project's own -- a deadlock, since
133
139
  # doc-kg and pycode-kg each depend on the other. Install them by hand:
134
- # pip install doc-kg pycode-kg # both on PyPI
135
- # pip install 'kg-rag @ git+https://github.com/Flux-Frontiers/KGRAG.git'
136
- # pip install 'agent-kg @ git+https://github.com/Flux-Frontiers/agent_kg.git'
140
+ # pip install doc-kg pycode-kg # both on PyPI
141
+ # pip install agent-kg kg-rag # both on PyPI as of 2026-07-29
137
142
  all = [
138
143
  "detect-secrets>=1.5.0",
139
144
  "markdown>=3.6",
@@ -32,7 +32,7 @@ KGModule SDK (build new domain KGs)::
32
32
  from pycode_kg import KGModule, KGExtractor, PyCodeKGExtractor, NodeSpec, EdgeSpec
33
33
  """
34
34
 
35
- __version__ = "0.21.0"
35
+ __version__ = "0.21.2"
36
36
  __author__ = "Eric G. Suchanek, PhD"
37
37
 
38
38
  # Low-level primitives (locked v0 contract)
@@ -4,7 +4,7 @@ Measures module interaction complexity: how many unique modules each module call
4
4
  For well-modularized codebases, identifies orchestrator and hub modules.
5
5
 
6
6
  Author: Eric G. Suchanek, PhD
7
- Last Revision: 2026-04-27 23:29:23
7
+ Last Revision: 2026-07-28 22:44:43
8
8
  License: Elastic 2.0
9
9
  """
10
10
 
@@ -12,7 +12,7 @@ Public API:
12
12
  - :func:`aggregate_module_scores` — roll node scores up to module level.
13
13
 
14
14
  Author: Eric G. Suchanek, PhD
15
- Last Revision: 2026-05-01 21:46:11
15
+ Last Revision: 2026-07-28 22:44:43
16
16
  """
17
17
 
18
18
  from __future__ import annotations
@@ -3,7 +3,7 @@ Framework Detector for PyCodeKG.
3
3
  Identifies repo-defining abstractions using centrality and cross-module signals.
4
4
 
5
5
  Author: Eric G. Suchanek, PhD
6
- Last Revision: 2026-07-15 22:51:18
6
+ Last Revision: 2026-07-28 22:44:43
7
7
  License: Elastic 2.0
8
8
  """
9
9
 
@@ -6,7 +6,7 @@ CLI command for installing PyCodeKG git hooks:
6
6
  install-hooks — install the pre-commit snapshot hook into .git/hooks/
7
7
 
8
8
  Author: Eric G. Suchanek, PhD
9
- Last Revision: 2026-04-06 09:21:00
9
+ Last Revision: 2026-07-29 15:21:32
10
10
  """
11
11
 
12
12
  from __future__ import annotations
@@ -25,10 +25,21 @@ from pycode_kg.cli.main import cli
25
25
 
26
26
  _PRE_COMMIT_HOOK = """\
27
27
  #!/usr/bin/env bash
28
- # PyCodeKG pre-commit hook — keeps the local index in sync and captures a
29
- # metrics snapshot BEFORE quality checks run.
28
+ # PyCodeKG pre-commit hook — runs quality checks first, then rebuilds the local
29
+ # index and captures a metrics snapshot.
30
30
  # Installed by: pycodekg install-hooks
31
31
  # Skip with: PYCODEKG_SKIP_SNAPSHOT=1 git commit ...
32
+ #
33
+ # Order matters, and it is deliberately checks-then-index:
34
+ #
35
+ # * `pre-commit run` stashes unstaged changes and restores them afterwards.
36
+ # Rebuilding the index before that ran meant the build's freshly-rewritten
37
+ # snapshots/manifest.json landed inside the stash window, where the restore
38
+ # could fail with "patch does not apply" and abort the commit outright — or,
39
+ # worse, let a staged deletion of a tracked snapshot slip into the commit.
40
+ # Building afterwards keeps KG artifacts entirely outside that window.
41
+ # * A full index rebuild costs 60-90s. There is no reason to pay it for a
42
+ # commit that ruff/ty/pytest is about to reject.
32
43
  set -euo pipefail
33
44
 
34
45
  [ "${PYCODEKG_SKIP_SNAPSHOT:-0}" = "1" ] && exit 0
@@ -37,7 +48,20 @@ REPO_ROOT="$(git rev-parse --show-toplevel)"
37
48
 
38
49
  cd "$REPO_ROOT"
39
50
 
40
- # Capture the tree hash of the staged index NOW — before any tool modifies files.
51
+ # Quality checks first (ruff, ty, pytest, detect-secrets, ...). Delegates to
52
+ # .pre-commit-config.yaml so quality checks stay in one place. A hook that
53
+ # rewrites files also exits non-zero here, so we never index a tree that is
54
+ # about to be reformatted.
55
+ PRECOMMIT="$REPO_ROOT/.venv/bin/pre-commit"
56
+ if [ -x "$PRECOMMIT" ]; then
57
+ "$PRECOMMIT" run || exit 1
58
+ elif command -v pre-commit &>/dev/null; then
59
+ pre-commit run || exit 1
60
+ fi
61
+
62
+ # Capture the tree hash now that the checks have passed and nothing further
63
+ # will modify the working tree — this keys the snapshot to the content that is
64
+ # actually about to be committed.
41
65
  TREE_HASH=$(git write-tree)
42
66
  BRANCH=$(git rev-parse --abbrev-ref HEAD)
43
67
 
@@ -51,19 +75,11 @@ BRANCH=$(git rev-parse --abbrev-ref HEAD)
51
75
  --branch "$BRANCH" \\
52
76
  || { echo "[pycodekg] snapshot skipped (run 'pycodekg build' to initialize)" >&2; }
53
77
 
54
- # Stage the snapshot directory so it is included in the commit.
78
+ # Stage the snapshot directory so it is included in the commit. These files are
79
+ # added after `pre-commit run`, so they are not scanned by it — detect-secrets
80
+ # already excludes snapshots/ by config, which is why that is safe.
55
81
  git add .pycodekg/snapshots/ 2>/dev/null || true
56
82
 
57
- # Run pre-commit framework checks (ruff, mypy, detect-secrets, etc.) AFTER
58
- # snapshots are captured and staged. Delegates to .pre-commit-config.yaml so
59
- # quality checks stay in one place.
60
- PRECOMMIT="$REPO_ROOT/.venv/bin/pre-commit"
61
- if [ -x "$PRECOMMIT" ]; then
62
- "$PRECOMMIT" run || exit 1
63
- elif command -v pre-commit &>/dev/null; then
64
- pre-commit run || exit 1
65
- fi
66
-
67
83
  exit 0
68
84
  """
69
85
 
@@ -23,7 +23,7 @@ No persistence, no embeddings, no LLMs—just pure AST extraction. Integration w
23
23
  vector databases and semantic search happens downstream.
24
24
 
25
25
  Author: Eric G. Suchanek, PhD
26
- Last Revision: 2026-05-23 14:45:37
26
+ Last Revision: 2026-07-28 22:44:43
27
27
  """
28
28
 
29
29
  from __future__ import annotations
@@ -35,7 +35,7 @@ Usage
35
35
  >>> prev = mgr.get_previous(tree_hash)
36
36
 
37
37
  Author: Eric G. Suchanek, PhD
38
- Last Revision: 2026-06-01
38
+ Last Revision: 2026-07-28
39
39
 
40
40
  License: Elastic 2.0
41
41
  """
File without changes