pycode-kg 0.19.0__tar.gz → 0.19.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.
- {pycode_kg-0.19.0 → pycode_kg-0.19.1}/PKG-INFO +34 -17
- {pycode_kg-0.19.0 → pycode_kg-0.19.1}/README.md +32 -15
- {pycode_kg-0.19.0 → pycode_kg-0.19.1}/pyproject.toml +2 -2
- {pycode_kg-0.19.0 → pycode_kg-0.19.1}/src/pycode_kg/__init__.py +1 -1
- {pycode_kg-0.19.0 → pycode_kg-0.19.1}/LICENSE +0 -0
- {pycode_kg-0.19.0 → pycode_kg-0.19.1}/src/pycode_kg/.DS_Store +0 -0
- {pycode_kg-0.19.0 → pycode_kg-0.19.1}/src/pycode_kg/__main__.py +0 -0
- {pycode_kg-0.19.0 → pycode_kg-0.19.1}/src/pycode_kg/analysis/__init__.py +0 -0
- {pycode_kg-0.19.0 → pycode_kg-0.19.1}/src/pycode_kg/analysis/bridge.py +0 -0
- {pycode_kg-0.19.0 → pycode_kg-0.19.1}/src/pycode_kg/analysis/centrality.py +0 -0
- {pycode_kg-0.19.0 → pycode_kg-0.19.1}/src/pycode_kg/analysis/framework_detector.py +0 -0
- {pycode_kg-0.19.0 → pycode_kg-0.19.1}/src/pycode_kg/analysis/hybrid_rank.py +0 -0
- {pycode_kg-0.19.0 → pycode_kg-0.19.1}/src/pycode_kg/app.py +0 -0
- {pycode_kg-0.19.0 → pycode_kg-0.19.1}/src/pycode_kg/architecture.py +0 -0
- {pycode_kg-0.19.0 → pycode_kg-0.19.1}/src/pycode_kg/build_pycodekg_lancedb.py +0 -0
- {pycode_kg-0.19.0 → pycode_kg-0.19.1}/src/pycode_kg/build_pycodekg_sqlite.py +0 -0
- {pycode_kg-0.19.0 → pycode_kg-0.19.1}/src/pycode_kg/cli/__init__.py +0 -0
- {pycode_kg-0.19.0 → pycode_kg-0.19.1}/src/pycode_kg/cli/cmd_analyze.py +0 -0
- {pycode_kg-0.19.0 → pycode_kg-0.19.1}/src/pycode_kg/cli/cmd_architecture.py +0 -0
- {pycode_kg-0.19.0 → pycode_kg-0.19.1}/src/pycode_kg/cli/cmd_bridges.py +0 -0
- {pycode_kg-0.19.0 → pycode_kg-0.19.1}/src/pycode_kg/cli/cmd_build.py +0 -0
- {pycode_kg-0.19.0 → pycode_kg-0.19.1}/src/pycode_kg/cli/cmd_build_full.py +0 -0
- {pycode_kg-0.19.0 → pycode_kg-0.19.1}/src/pycode_kg/cli/cmd_centrality.py +0 -0
- {pycode_kg-0.19.0 → pycode_kg-0.19.1}/src/pycode_kg/cli/cmd_explain.py +0 -0
- {pycode_kg-0.19.0 → pycode_kg-0.19.1}/src/pycode_kg/cli/cmd_framework_nodes.py +0 -0
- {pycode_kg-0.19.0 → pycode_kg-0.19.1}/src/pycode_kg/cli/cmd_hooks.py +0 -0
- {pycode_kg-0.19.0 → pycode_kg-0.19.1}/src/pycode_kg/cli/cmd_init.py +0 -0
- {pycode_kg-0.19.0 → pycode_kg-0.19.1}/src/pycode_kg/cli/cmd_mcp.py +0 -0
- {pycode_kg-0.19.0 → pycode_kg-0.19.1}/src/pycode_kg/cli/cmd_model.py +0 -0
- {pycode_kg-0.19.0 → pycode_kg-0.19.1}/src/pycode_kg/cli/cmd_query.py +0 -0
- {pycode_kg-0.19.0 → pycode_kg-0.19.1}/src/pycode_kg/cli/cmd_snapshot.py +0 -0
- {pycode_kg-0.19.0 → pycode_kg-0.19.1}/src/pycode_kg/cli/cmd_viz.py +0 -0
- {pycode_kg-0.19.0 → pycode_kg-0.19.1}/src/pycode_kg/cli/main.py +0 -0
- {pycode_kg-0.19.0 → pycode_kg-0.19.1}/src/pycode_kg/cli/options.py +0 -0
- {pycode_kg-0.19.0 → pycode_kg-0.19.1}/src/pycode_kg/config.py +0 -0
- {pycode_kg-0.19.0 → pycode_kg-0.19.1}/src/pycode_kg/explain.py +0 -0
- {pycode_kg-0.19.0 → pycode_kg-0.19.1}/src/pycode_kg/graph.py +0 -0
- {pycode_kg-0.19.0 → pycode_kg-0.19.1}/src/pycode_kg/index.py +0 -0
- {pycode_kg-0.19.0 → pycode_kg-0.19.1}/src/pycode_kg/kg.py +0 -0
- {pycode_kg-0.19.0 → pycode_kg-0.19.1}/src/pycode_kg/layout3d.py +0 -0
- {pycode_kg-0.19.0 → pycode_kg-0.19.1}/src/pycode_kg/mcp_server.py +0 -0
- {pycode_kg-0.19.0 → pycode_kg-0.19.1}/src/pycode_kg/module/__init__.py +0 -0
- {pycode_kg-0.19.0 → pycode_kg-0.19.1}/src/pycode_kg/module/base.py +0 -0
- {pycode_kg-0.19.0 → pycode_kg-0.19.1}/src/pycode_kg/module/extractor.py +0 -0
- {pycode_kg-0.19.0 → pycode_kg-0.19.1}/src/pycode_kg/module/types.py +0 -0
- {pycode_kg-0.19.0 → pycode_kg-0.19.1}/src/pycode_kg/pycodekg.py +0 -0
- {pycode_kg-0.19.0 → pycode_kg-0.19.1}/src/pycode_kg/pycodekg_query.py +0 -0
- {pycode_kg-0.19.0 → pycode_kg-0.19.1}/src/pycode_kg/pycodekg_snippet_packer.py +0 -0
- {pycode_kg-0.19.0 → pycode_kg-0.19.1}/src/pycode_kg/pycodekg_thorough_analysis.py +0 -0
- {pycode_kg-0.19.0 → pycode_kg-0.19.1}/src/pycode_kg/pycodekg_viz.py +0 -0
- {pycode_kg-0.19.0 → pycode_kg-0.19.1}/src/pycode_kg/pycodekg_viz3d.py +0 -0
- {pycode_kg-0.19.0 → pycode_kg-0.19.1}/src/pycode_kg/ranking/__init__.py +0 -0
- {pycode_kg-0.19.0 → pycode_kg-0.19.1}/src/pycode_kg/ranking/cli_rank.py +0 -0
- {pycode_kg-0.19.0 → pycode_kg-0.19.1}/src/pycode_kg/ranking/coderank.py +0 -0
- {pycode_kg-0.19.0 → pycode_kg-0.19.1}/src/pycode_kg/snapshots.py +0 -0
- {pycode_kg-0.19.0 → pycode_kg-0.19.1}/src/pycode_kg/sql/004_add_centrality_table.sql +0 -0
- {pycode_kg-0.19.0 → pycode_kg-0.19.1}/src/pycode_kg/store.py +0 -0
- {pycode_kg-0.19.0 → pycode_kg-0.19.1}/src/pycode_kg/utils.py +0 -0
- {pycode_kg-0.19.0 → pycode_kg-0.19.1}/src/pycode_kg/visitor.py +0 -0
- {pycode_kg-0.19.0 → pycode_kg-0.19.1}/src/pycode_kg/viz3d.py +0 -0
- {pycode_kg-0.19.0 → pycode_kg-0.19.1}/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.19.
|
|
3
|
+
Version: 0.19.1
|
|
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
|
|
@@ -66,7 +66,7 @@ Requires-Dist: streamlit (>=1.35.0) ; extra == "viz"
|
|
|
66
66
|
Requires-Dist: torch (>=2.5.1)
|
|
67
67
|
Requires-Dist: trame-vtk (>=2.0.0) ; extra == "all"
|
|
68
68
|
Requires-Dist: trame-vtk (>=2.0.0) ; extra == "viz3d"
|
|
69
|
-
Requires-Dist: transformers (>=4.57
|
|
69
|
+
Requires-Dist: transformers (>=4.40.0,<4.57)
|
|
70
70
|
Project-URL: Homepage, https://github.com/Flux-Frontiers/pycode_kg
|
|
71
71
|
Project-URL: Repository, https://github.com/Flux-Frontiers/pycode_kg
|
|
72
72
|
Description-Content-Type: text/markdown
|
|
@@ -78,7 +78,7 @@ Description-Content-Type: text/markdown
|
|
|
78
78
|
|
|
79
79
|
[](https://www.python.org/)
|
|
80
80
|
[](https://www.elastic.co/licensing/elastic-license)
|
|
81
|
-
[](https://github.com/Flux-Frontiers/pycode_kg/releases)
|
|
82
82
|
[](https://github.com/Flux-Frontiers/pycode_kg/actions/workflows/ci.yml)
|
|
83
83
|
[](https://python-poetry.org/)
|
|
84
84
|
[](https://zenodo.org/badge/latestdoi/1202379010)
|
|
@@ -117,23 +117,40 @@ PyCodeKG is designed to be useful at both ends — as a standalone command-line
|
|
|
117
117
|
|
|
118
118
|
### 1. Standalone — `pycodekg analyze`
|
|
119
119
|
|
|
120
|
-
This is the
|
|
120
|
+
This single command is the actual reason I wrote this module. I got tired of my LLM doing grep on my src/ in order to get a good analysis of the codebase. This command runs fifteen analysis passes in seconds and the output drops straight into your favorite coding LLM for targeted improvement suggestions. I used this process to iteratively improve PyCodeKG and several of the analysis passes were added as a result.
|
|
121
|
+
|
|
122
|
+
The analysis/ has files *_analysis_<date>.md - I ran PyCodeKG against **numpy** and **matplotlib** for fun.
|
|
121
123
|
|
|
122
124
|
```bash
|
|
125
|
+
pycodekg init # downloads embedder
|
|
123
126
|
pycodekg build --repo . # one-time index
|
|
124
|
-
pycodekg analyze
|
|
127
|
+
pycodekg analyze. # the full report
|
|
125
128
|
```
|
|
126
129
|
|
|
127
|
-
|
|
128
|
-
|
|
129
|
-
|
|
130
|
-
-
|
|
131
|
-
|
|
132
|
-
|
|
133
|
-
|
|
134
|
-
|
|
135
|
-
|
|
136
|
-
|
|
130
|
+
**Note**
|
|
131
|
+
The first-time run can take some time to warm up. Be patient.
|
|
132
|
+
|
|
133
|
+
The 15-phase pipeline runs in sequence and surfaces several important metrics:
|
|
134
|
+
|
|
135
|
+
| # | Phase | What it surfaces |
|
|
136
|
+
|---|-------|-----------------|
|
|
137
|
+
| 1 | Baseline metrics | Node/edge counts, graph shape |
|
|
138
|
+
| 2 | CodeRank (global PageRank) | Structurally most important symbols |
|
|
139
|
+
| 3 | Fan-in analysis | Heavily depended-on functions (breaking-change risk) |
|
|
140
|
+
| 4 | Fan-out analysis | Orchestrators and complexity hotspots |
|
|
141
|
+
| 5 | Dependency analysis | Orphaned / dead code candidates |
|
|
142
|
+
| 6 | Pattern detection | Anti-patterns and structural red flags |
|
|
143
|
+
| 7 | Module coupling | Tightly coupled pairs, import graph density |
|
|
144
|
+
| 8 | Critical paths | Longest call chains, bottlenecks |
|
|
145
|
+
| 9 | Public API identification | Exposed vs. internal surface |
|
|
146
|
+
| 10 | Docstring coverage | By module, class, function, method |
|
|
147
|
+
| 11 | Inheritance hierarchy | Depth, multiple inheritance, diamond patterns |
|
|
148
|
+
| 12 | Insight synthesis | Issues + strengths callouts |
|
|
149
|
+
| 13 | Snapshot history | Metric trends across releases |
|
|
150
|
+
| 14 | Structural centrality (SIR) | Bridge nodes, graph removal impact |
|
|
151
|
+
| 15 | Concern-based ranking | Nodes grouped by architectural concern |
|
|
152
|
+
|
|
153
|
+
Every finding maps to a file and line number — no hallucinated signatures, no probabilistic guesses. The Markdown output is LLM-ready; the JSON snapshot is CI-gate-ready. Reach for `analyze` before any non-trivial refactor, at every release, and whenever you inherit an unfamiliar codebase. Full reference: [docs/Analyze.md](docs/Analyze.md).
|
|
137
154
|
|
|
138
155
|
```bash
|
|
139
156
|
pycodekg analyze --quiet --json ~/.claude/pycodekg_analysis_latest.json
|
|
@@ -190,7 +207,7 @@ The graph is built around four node kinds (module, class, function, method) and
|
|
|
190
207
|
|
|
191
208
|
---
|
|
192
209
|
|
|
193
|
-
## What you can
|
|
210
|
+
## What you can do with it
|
|
194
211
|
|
|
195
212
|
| If you want to… | Reach for | Detail |
|
|
196
213
|
|---|---|---|
|
|
@@ -201,7 +218,7 @@ The graph is built around four node kinds (module, class, function, method) and
|
|
|
201
218
|
| **Pull source-grounded context for an LLM** | `pycodekg pack "..." --format md` | [docs/CHEATSHEET.md](docs/CHEATSHEET.md) |
|
|
202
219
|
| **Run a hybrid semantic + structural query** | `pycodekg query "..."` | [docs/CHEATSHEET.md](docs/CHEATSHEET.md) |
|
|
203
220
|
| **Browse the graph interactively** | `pycodekg viz` (Streamlit) | [docs/INSTALLATION.md](docs/INSTALLATION.md) |
|
|
204
|
-
| **See call graphs in 3-D** | `pycodekg viz3d --layout funnel` | [docs/VIZ3D.md](docs/VIZ3D.md) |
|
|
221
|
+
| **See call graphs in 3-D** *(active development — functional but rough)* | `pycodekg viz3d --layout funnel` | [docs/VIZ3D.md](docs/VIZ3D.md) |
|
|
205
222
|
| **Wire it into Claude / Copilot / Cline** | `pycodekg mcp` | [docs/MCP.md](docs/MCP.md) |
|
|
206
223
|
|
|
207
224
|
If you only read one doc after this one, read [docs/Analyze.md](docs/Analyze.md) — that's where most of the day-to-day value lives.
|
|
@@ -5,7 +5,7 @@
|
|
|
5
5
|
|
|
6
6
|
[](https://www.python.org/)
|
|
7
7
|
[](https://www.elastic.co/licensing/elastic-license)
|
|
8
|
-
[](https://github.com/Flux-Frontiers/pycode_kg/releases)
|
|
9
9
|
[](https://github.com/Flux-Frontiers/pycode_kg/actions/workflows/ci.yml)
|
|
10
10
|
[](https://python-poetry.org/)
|
|
11
11
|
[](https://zenodo.org/badge/latestdoi/1202379010)
|
|
@@ -44,23 +44,40 @@ PyCodeKG is designed to be useful at both ends — as a standalone command-line
|
|
|
44
44
|
|
|
45
45
|
### 1. Standalone — `pycodekg analyze`
|
|
46
46
|
|
|
47
|
-
This is the
|
|
47
|
+
This single command is the actual reason I wrote this module. I got tired of my LLM doing grep on my src/ in order to get a good analysis of the codebase. This command runs fifteen analysis passes in seconds and the output drops straight into your favorite coding LLM for targeted improvement suggestions. I used this process to iteratively improve PyCodeKG and several of the analysis passes were added as a result.
|
|
48
|
+
|
|
49
|
+
The analysis/ has files *_analysis_<date>.md - I ran PyCodeKG against **numpy** and **matplotlib** for fun.
|
|
48
50
|
|
|
49
51
|
```bash
|
|
52
|
+
pycodekg init # downloads embedder
|
|
50
53
|
pycodekg build --repo . # one-time index
|
|
51
|
-
pycodekg analyze
|
|
54
|
+
pycodekg analyze. # the full report
|
|
52
55
|
```
|
|
53
56
|
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
-
|
|
58
|
-
|
|
59
|
-
|
|
60
|
-
|
|
61
|
-
|
|
62
|
-
|
|
63
|
-
|
|
57
|
+
**Note**
|
|
58
|
+
The first-time run can take some time to warm up. Be patient.
|
|
59
|
+
|
|
60
|
+
The 15-phase pipeline runs in sequence and surfaces several important metrics:
|
|
61
|
+
|
|
62
|
+
| # | Phase | What it surfaces |
|
|
63
|
+
|---|-------|-----------------|
|
|
64
|
+
| 1 | Baseline metrics | Node/edge counts, graph shape |
|
|
65
|
+
| 2 | CodeRank (global PageRank) | Structurally most important symbols |
|
|
66
|
+
| 3 | Fan-in analysis | Heavily depended-on functions (breaking-change risk) |
|
|
67
|
+
| 4 | Fan-out analysis | Orchestrators and complexity hotspots |
|
|
68
|
+
| 5 | Dependency analysis | Orphaned / dead code candidates |
|
|
69
|
+
| 6 | Pattern detection | Anti-patterns and structural red flags |
|
|
70
|
+
| 7 | Module coupling | Tightly coupled pairs, import graph density |
|
|
71
|
+
| 8 | Critical paths | Longest call chains, bottlenecks |
|
|
72
|
+
| 9 | Public API identification | Exposed vs. internal surface |
|
|
73
|
+
| 10 | Docstring coverage | By module, class, function, method |
|
|
74
|
+
| 11 | Inheritance hierarchy | Depth, multiple inheritance, diamond patterns |
|
|
75
|
+
| 12 | Insight synthesis | Issues + strengths callouts |
|
|
76
|
+
| 13 | Snapshot history | Metric trends across releases |
|
|
77
|
+
| 14 | Structural centrality (SIR) | Bridge nodes, graph removal impact |
|
|
78
|
+
| 15 | Concern-based ranking | Nodes grouped by architectural concern |
|
|
79
|
+
|
|
80
|
+
Every finding maps to a file and line number — no hallucinated signatures, no probabilistic guesses. The Markdown output is LLM-ready; the JSON snapshot is CI-gate-ready. Reach for `analyze` before any non-trivial refactor, at every release, and whenever you inherit an unfamiliar codebase. Full reference: [docs/Analyze.md](docs/Analyze.md).
|
|
64
81
|
|
|
65
82
|
```bash
|
|
66
83
|
pycodekg analyze --quiet --json ~/.claude/pycodekg_analysis_latest.json
|
|
@@ -117,7 +134,7 @@ The graph is built around four node kinds (module, class, function, method) and
|
|
|
117
134
|
|
|
118
135
|
---
|
|
119
136
|
|
|
120
|
-
## What you can
|
|
137
|
+
## What you can do with it
|
|
121
138
|
|
|
122
139
|
| If you want to… | Reach for | Detail |
|
|
123
140
|
|---|---|---|
|
|
@@ -128,7 +145,7 @@ The graph is built around four node kinds (module, class, function, method) and
|
|
|
128
145
|
| **Pull source-grounded context for an LLM** | `pycodekg pack "..." --format md` | [docs/CHEATSHEET.md](docs/CHEATSHEET.md) |
|
|
129
146
|
| **Run a hybrid semantic + structural query** | `pycodekg query "..."` | [docs/CHEATSHEET.md](docs/CHEATSHEET.md) |
|
|
130
147
|
| **Browse the graph interactively** | `pycodekg viz` (Streamlit) | [docs/INSTALLATION.md](docs/INSTALLATION.md) |
|
|
131
|
-
| **See call graphs in 3-D** | `pycodekg viz3d --layout funnel` | [docs/VIZ3D.md](docs/VIZ3D.md) |
|
|
148
|
+
| **See call graphs in 3-D** *(active development — functional but rough)* | `pycodekg viz3d --layout funnel` | [docs/VIZ3D.md](docs/VIZ3D.md) |
|
|
132
149
|
| **Wire it into Claude / Copilot / Cline** | `pycodekg mcp` | [docs/MCP.md](docs/MCP.md) |
|
|
133
150
|
|
|
134
151
|
If you only read one doc after this one, read [docs/Analyze.md](docs/Analyze.md) — that's where most of the day-to-day value lives.
|
|
@@ -66,7 +66,7 @@ ruff = ">=0.4.0"
|
|
|
66
66
|
# ---------------------------------------------------------------------------
|
|
67
67
|
[project]
|
|
68
68
|
name = "pycode-kg"
|
|
69
|
-
version = "0.19.
|
|
69
|
+
version = "0.19.1"
|
|
70
70
|
description = "A tool to build a searchable knowledge graph from Python repositories"
|
|
71
71
|
readme = "README.md"
|
|
72
72
|
license = "Elastic-2.0"
|
|
@@ -94,7 +94,7 @@ dependencies = [
|
|
|
94
94
|
"safetensors>=0.5.0",
|
|
95
95
|
"sentence-transformers>=5.4.1",
|
|
96
96
|
"torch>=2.5.1",
|
|
97
|
-
"transformers>=4.57
|
|
97
|
+
"transformers>=4.40.0,<4.57",
|
|
98
98
|
"kgmodule-utils>=0.2.1",
|
|
99
99
|
]
|
|
100
100
|
|
|
@@ -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.19.
|
|
35
|
+
__version__ = "0.19.1"
|
|
36
36
|
__author__ = "Eric G. Suchanek, PhD"
|
|
37
37
|
|
|
38
38
|
# Low-level primitives (locked v0 contract)
|
|
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
|
|
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
|
|
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
|