codryx 0.1.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.
Files changed (54) hide show
  1. codryx-0.1.0/LICENSE +21 -0
  2. codryx-0.1.0/PKG-INFO +365 -0
  3. codryx-0.1.0/README.md +340 -0
  4. codryx-0.1.0/codryx/__init__.py +23 -0
  5. codryx-0.1.0/codryx/audit.py +46 -0
  6. codryx-0.1.0/codryx/ci_dashboard.py +24 -0
  7. codryx-0.1.0/codryx/ci_realtime.py +34 -0
  8. codryx-0.1.0/codryx/cli.py +220 -0
  9. codryx-0.1.0/codryx/code_analyzer.py +86 -0
  10. codryx-0.1.0/codryx/config.py +28 -0
  11. codryx-0.1.0/codryx/cost_analyzer.py +9 -0
  12. codryx-0.1.0/codryx/expr.py +97 -0
  13. codryx-0.1.0/codryx/gatekeeper.py +7 -0
  14. codryx-0.1.0/codryx/guard.py +62 -0
  15. codryx-0.1.0/codryx/ide_ext/lsp.py +28 -0
  16. codryx-0.1.0/codryx/ide_ext/pycharm.py +24 -0
  17. codryx-0.1.0/codryx/ide_ext/pycharm_lsp/handlers.py +17 -0
  18. codryx-0.1.0/codryx/ide_ext/pycharm_lsp/protocol.py +10 -0
  19. codryx-0.1.0/codryx/ide_ext/pycharm_lsp/server.py +33 -0
  20. codryx-0.1.0/codryx/ide_ext/vscode.py +30 -0
  21. codryx-0.1.0/codryx/ide_ext/vscode_lsp/handlers.py +17 -0
  22. codryx-0.1.0/codryx/ide_ext/vscode_lsp/protocol.py +10 -0
  23. codryx-0.1.0/codryx/ide_ext/vscode_lsp/server.py +33 -0
  24. codryx-0.1.0/codryx/ide_plugin.py +42 -0
  25. codryx-0.1.0/codryx/license.py +63 -0
  26. codryx-0.1.0/codryx/migration.py +76 -0
  27. codryx-0.1.0/codryx/notifications.py +50 -0
  28. codryx-0.1.0/codryx/notifications_rich.py +32 -0
  29. codryx-0.1.0/codryx/rule_loader.py +9 -0
  30. codryx-0.1.0/codryx/scanner.py +89 -0
  31. codryx-0.1.0/codryx/security.py +68 -0
  32. codryx-0.1.0/codryx/security_remediation.py +42 -0
  33. codryx-0.1.0/codryx/utils.py +59 -0
  34. codryx-0.1.0/codryx/visuals.py +34 -0
  35. codryx-0.1.0/codryx.egg-info/PKG-INFO +365 -0
  36. codryx-0.1.0/codryx.egg-info/SOURCES.txt +52 -0
  37. codryx-0.1.0/codryx.egg-info/dependency_links.txt +1 -0
  38. codryx-0.1.0/codryx.egg-info/entry_points.txt +2 -0
  39. codryx-0.1.0/codryx.egg-info/requires.txt +12 -0
  40. codryx-0.1.0/codryx.egg-info/top_level.txt +1 -0
  41. codryx-0.1.0/pyproject.toml +41 -0
  42. codryx-0.1.0/setup.cfg +4 -0
  43. codryx-0.1.0/tests/test_ci_dashboard.py +20 -0
  44. codryx-0.1.0/tests/test_code_analyzer.py +22 -0
  45. codryx-0.1.0/tests/test_gatekeeper.py +13 -0
  46. codryx-0.1.0/tests/test_guard.py +29 -0
  47. codryx-0.1.0/tests/test_ide_ext.py +20 -0
  48. codryx-0.1.0/tests/test_ide_lsp.py +26 -0
  49. codryx-0.1.0/tests/test_ide_plugin.py +15 -0
  50. codryx-0.1.0/tests/test_license.py +23 -0
  51. codryx-0.1.0/tests/test_notifications.py +15 -0
  52. codryx-0.1.0/tests/test_notifications_rich.py +18 -0
  53. codryx-0.1.0/tests/test_notifications_rich2.py +17 -0
  54. codryx-0.1.0/tests/test_security_remediation.py +15 -0
codryx-0.1.0/LICENSE ADDED
@@ -0,0 +1,21 @@
1
+ MIT License
2
+
3
+ Copyright (c) 2026 Muhammad Zaid Tahir
4
+
5
+ Permission is hereby granted, free of charge, to any person obtaining a copy
6
+ of this software and associated documentation files (the "Software"), to deal
7
+ in the Software without restriction, including without limitation the rights
8
+ to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
9
+ copies of the Software, and to permit persons to whom the Software is
10
+ furnished to do so, subject to the following conditions:
11
+
12
+ The above copyright notice and this permission notice shall be included in all
13
+ copies or substantial portions of the Software.
14
+
15
+ THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
16
+ IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
17
+ FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
18
+ AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
19
+ LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
20
+ OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
21
+ SOFTWARE.
codryx-0.1.0/PKG-INFO ADDED
@@ -0,0 +1,365 @@
1
+ Metadata-Version: 2.4
2
+ Name: codryx
3
+ Version: 0.1.0
4
+ Summary: Python developer toolkit for code safety and health
5
+ Author-email: Muhammad Zaid Tahir <mianzaid049@gmail.com>
6
+ License-Expression: MIT
7
+ Project-URL: Homepage, https://github.com/yourusername/codryx
8
+ Project-URL: Documentation, https://github.com/yourusername/codryx#readme
9
+ Project-URL: Repository, https://github.com/yourusername/codryx
10
+ Requires-Python: >=3.10
11
+ Description-Content-Type: text/markdown
12
+ License-File: LICENSE
13
+ Requires-Dist: typer>=0.9.0
14
+ Requires-Dist: rich>=13.7.0
15
+ Requires-Dist: requests>=2.31.0
16
+ Requires-Dist: jinja2>=3.1.2
17
+ Requires-Dist: packaging>=23.2
18
+ Requires-Dist: pyyaml>=6.0.1
19
+ Provides-Extra: dev
20
+ Requires-Dist: pytest; extra == "dev"
21
+ Requires-Dist: pytest-cov; extra == "dev"
22
+ Requires-Dist: flake8; extra == "dev"
23
+ Requires-Dist: mypy; extra == "dev"
24
+ Dynamic: license-file
25
+
26
+ codryx
27
+ codryx is a lightweight Python code quality and dependency health toolkit with progressive phases of features (1–6) focused on:
28
+
29
+ Guarded function contracts with strict mode
30
+ Dead code, unused imports, and unused symbols detection
31
+ Dependency and security scanning
32
+ Migration PR automation with optional auto-merge
33
+ License graph and gatekeeper health scoring
34
+ Interactive dashboards, IDE helpers, rich notifications
35
+ Optional real-time CI dashboards and websocket broadcasting
36
+ Installation
37
+ Recommended: create a virtual environment and install optional dependencies.
38
+ Optional dependencies enhance CLI UX and features but are not required.
39
+ # Create venv
40
+ python -m venv .venv
41
+
42
+ # Activate on Windows
43
+ .\\.venv\\Scripts\\activate
44
+
45
+ # Install optional dependencies
46
+ pip install typer rich requests pyyaml packaging jinja2 websockets
47
+ Quick Start
48
+
49
+ CLI help: python -m codryx.cli help
50
+
51
+ Run doctor: python -m codryx.cli doctor
52
+
53
+ Example scripts: python run_examples.py
54
+
55
+ CLI Usage
56
+
57
+ Help: python -m codryx.cli help
58
+
59
+ Dependencies: codryx deps scan
60
+
61
+ Code: codryx code scan --root .
62
+
63
+ Security: codryx security scan
64
+
65
+ Doctor: codryx doctor
66
+
67
+ Strict mode: codryx strict
68
+
69
+ Fallback: without Typer/Rich, use python -m codryx.cli doctor
70
+
71
+ Python API
72
+
73
+ Guards: from codryx import guard, enable_strict_mode
74
+
75
+ Code scan: from codryx import scan_code
76
+
77
+ Dependency scan: from codryx import scan_dependencies
78
+
79
+ Example: examples/example_usage.py
80
+
81
+ Environment Variables
82
+
83
+ PY_GUARDIAN_MODE: default "development"
84
+
85
+ PY_GUARDIAN_STRICT: "1"/"true"/"yes" to enable strict mode
86
+
87
+ PY_GUARDIAN_REPORT_DIR: output directory (default "reports")
88
+
89
+ PY_GUARDIAN_AUDIT_ASYNC: "1"/"true"/"yes" to enable async audit
90
+
91
+ PY_GUARDIAN_AUDIT_QUEUE: queue size (default 1024)
92
+
93
+ PY_GUARDIAN_HEALTH_THRESHOLD: numeric threshold to fail gate
94
+
95
+ PY_GUARDIAN_LICENSE_BLOCKLIST: comma-separated license names to flag
96
+
97
+ PY_GUARDIAN_SLACK_WEBHOOK: Slack incoming webhook URL
98
+
99
+ PY_GUARDIAN_TEAMS_WEBHOOK: Teams incoming webhook URL
100
+
101
+ GITHUB_TOKEN / GITLAB_TOKEN: tokens to create PRs
102
+
103
+ PY_GUARDIAN_APPROVED: "1"/"true"/"yes" allows auto-merge for supported providers
104
+
105
+ Phase 1–6 Highlights
106
+
107
+ Phase 1–2: Guards, strict mode, dead code detection, dependency scanning
108
+
109
+ Phase 3: License graph/conflicts, gatekeeper, dashboards
110
+
111
+ Phase 4: Notifications, interactive charts, IDE hints
112
+
113
+ Phase 5: Rich notifications, realtime CI dashboard, security auto-remediation
114
+
115
+ Phase 6: Optional IDE extension modules, websocket broadcaster, pipeline snippets
116
+
117
+ Examples
118
+
119
+ examples/example_usage.py → rules, code scan, PR payload
120
+
121
+ IDE helpers:
122
+
123
+ examples/ide_preview.py → guard highlights and health hints
124
+
125
+ examples/vscode_plugin_example.py → VSCode diagnostics and quickfix
126
+
127
+ Dashboards:
128
+
129
+ examples/ci_dashboard_example.py → writes metrics.json
130
+
131
+ Open codryx/templates/ci_dashboard.html from the reports directory
132
+
133
+ Notifications:
134
+
135
+ examples/notifications_example.py → simple webhook use
136
+
137
+ examples/notifications_rich_example.py → Slack/Teams rich payloads
138
+
139
+ Security:
140
+
141
+ examples/security_pipeline_example.py → CI pipeline snippets
142
+
143
+ Running Examples Easily
144
+
145
+ Use the helper script: python run_examples.py
146
+
147
+ This sets PYTHONPATH to the project root and runs all example scripts
148
+
149
+ Verifying the Build
150
+
151
+ Activate venv: .\\.venv\\Scripts\\activate
152
+
153
+ Run CLI commands: help, deps scan, code scan, security scan, doctor, strict
154
+
155
+ Run examples: python run_examples.py
156
+
157
+ Run tests: python -m unittest discover -s tests -p "test*.py" -q
158
+
159
+ Optional Modules
160
+
161
+ IDE extensions (VSCode/PyCharm): codryx/ide_ext/
162
+
163
+ Real-time CI broadcaster: codryx/ci_realtime.py (requires websockets)
164
+
165
+ Rich notifications: codryx/notifications_rich.py
166
+
167
+ Security remediation: codryx/security_remediation.py
168
+
169
+ License
170
+ MIT License
171
+
172
+ Copyright (c) 2026 Your Name
173
+
174
+ Permission is hereby granted, free of charge, to any person obtaining a copy
175
+ of this software and associated documentation files (the "Software"), to deal
176
+ in the Software without restriction, including without limitation the rights
177
+ to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
178
+ copies of the Software, and to permit persons to whom the Software is
179
+ furnished to do so, subject to the following conditions:
180
+
181
+ [... full MIT license text here ...]
182
+
183
+ ---
184
+
185
+ ✅ You can **copy this entire block** and save it as `README.md` in your project root.
186
+
187
+ If you want, I can also make a **ready-to-run one-liner command in PowerShell or Linux terminal** that creates this file automatically for you.
188
+
189
+ Do you want me to do that?
190
+ provide me all in single markdown
191
+
192
+ Sure! Here’s your all-in-one README.md in a single markdown block, ready to copy and save as README.md in your project root. It includes the license, instructions, examples, and phase highlights.
193
+
194
+ # codryx
195
+
196
+ codryx is a lightweight Python code quality and dependency health toolkit with progressive phases of features (1–6) focused on:
197
+
198
+ - Guarded function contracts with strict mode
199
+ - Dead code, unused imports, and unused symbols detection
200
+ - Dependency and security scanning
201
+ - Migration PR automation with optional auto-merge
202
+ - License graph and gatekeeper health scoring
203
+ - Interactive dashboards, IDE helpers, rich notifications
204
+ - Optional real-time CI dashboards and websocket broadcasting
205
+
206
+ ## Installation
207
+
208
+ - Recommended: create a virtual environment and install optional dependencies.
209
+ - Optional dependencies enhance CLI UX and features but are not required.
210
+
211
+ ```bash
212
+ # Create venv
213
+ python -m venv .venv
214
+
215
+ # Activate on Windows
216
+ .\\.venv\\Scripts\\activate
217
+
218
+ # Install optional dependencies
219
+ pip install typer rich requests pyyaml packaging jinja2 websockets
220
+ Quick Start
221
+
222
+ CLI help: python -m codryx.cli help
223
+
224
+ Run doctor: python -m codryx.cli doctor
225
+
226
+ Example scripts: python run_examples.py
227
+
228
+ CLI Usage
229
+
230
+ Help: python -m codryx.cli help
231
+
232
+ Dependencies: codryx deps scan
233
+
234
+ Code: codryx code scan --root .
235
+
236
+ Security: codryx security scan
237
+
238
+ Doctor: codryx doctor
239
+
240
+ Strict mode: codryx strict
241
+
242
+ Fallback: without Typer/Rich, use python -m codryx.cli doctor
243
+
244
+ Python API
245
+
246
+ Guards: from codryx import guard, enable_strict_mode
247
+
248
+ Code scan: from codryx import scan_code
249
+
250
+ Dependency scan: from codryx import scan_dependencies
251
+
252
+ Example: examples/example_usage.py
253
+
254
+ Environment Variables
255
+
256
+ PY_GUARDIAN_MODE: default "development"
257
+
258
+ PY_GUARDIAN_STRICT: "1"/"true"/"yes" to enable strict mode
259
+
260
+ PY_GUARDIAN_REPORT_DIR: output directory (default "reports")
261
+
262
+ PY_GUARDIAN_AUDIT_ASYNC: "1"/"true"/"yes" to enable async audit
263
+
264
+ PY_GUARDIAN_AUDIT_QUEUE: queue size (default 1024)
265
+
266
+ PY_GUARDIAN_HEALTH_THRESHOLD: numeric threshold to fail gate
267
+
268
+ PY_GUARDIAN_LICENSE_BLOCKLIST: comma-separated license names to flag
269
+
270
+ PY_GUARDIAN_SLACK_WEBHOOK: Slack incoming webhook URL
271
+
272
+ PY_GUARDIAN_TEAMS_WEBHOOK: Teams incoming webhook URL
273
+
274
+ GITHUB_TOKEN / GITLAB_TOKEN: tokens to create PRs
275
+
276
+ PY_GUARDIAN_APPROVED: "1"/"true"/"yes" allows auto-merge for supported providers
277
+
278
+ Phase 1–6 Highlights
279
+
280
+ Phase 1–2: Guards, strict mode, dead code detection, dependency scanning
281
+
282
+ Phase 3: License graph/conflicts, gatekeeper, dashboards
283
+
284
+ Phase 4: Notifications, interactive charts, IDE hints
285
+
286
+ Phase 5: Rich notifications, realtime CI dashboard, security auto-remediation
287
+
288
+ Phase 6: Optional IDE extension modules, websocket broadcaster, pipeline snippets
289
+
290
+ Examples
291
+
292
+ examples/example_usage.py → rules, code scan, PR payload
293
+
294
+ IDE helpers:
295
+
296
+ examples/ide_preview.py → guard highlights and health hints
297
+
298
+ examples/vscode_plugin_example.py → VSCode diagnostics and quickfix
299
+
300
+ Dashboards:
301
+
302
+ examples/ci_dashboard_example.py → writes metrics.json
303
+
304
+ Open codryx/templates/ci_dashboard.html from the reports directory
305
+
306
+ Notifications:
307
+
308
+ examples/notifications_example.py → simple webhook use
309
+
310
+ examples/notifications_rich_example.py → Slack/Teams rich payloads
311
+
312
+ Security:
313
+
314
+ examples/security_pipeline_example.py → CI pipeline snippets
315
+
316
+ Running Examples Easily
317
+
318
+ Use the helper script: python run_examples.py
319
+
320
+ This sets PYTHONPATH to the project root and runs all example scripts
321
+
322
+ Verifying the Build
323
+
324
+ Activate venv: .\\.venv\\Scripts\\activate
325
+
326
+ Run CLI commands: help, deps scan, code scan, security scan, doctor, strict
327
+
328
+ Run examples: python run_examples.py
329
+
330
+ Run tests: python -m unittest discover -s tests -p "test*.py" -q
331
+
332
+ Optional Modules
333
+
334
+ IDE extensions (VSCode/PyCharm): codryx/ide_ext/
335
+
336
+ Real-time CI broadcaster: codryx/ci_realtime.py (requires websockets)
337
+
338
+ Rich notifications: codryx/notifications_rich.py
339
+
340
+ Security remediation: codryx/security_remediation.py
341
+
342
+ License
343
+ MIT License
344
+
345
+ Copyright (c) 2026 Muhammad Zaid Tahir
346
+
347
+ Permission is hereby granted, free of charge, to any person obtaining a copy
348
+ of this software and associated documentation files (the "Software"), to deal
349
+ in the Software without restriction, including without limitation the rights
350
+ to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
351
+ copies of the Software, and to permit persons to whom the Software is
352
+ furnished to do so, subject to the following conditions:
353
+
354
+ The above copyright notice and this permission notice shall be included in all
355
+ copies or substantial portions of the Software.
356
+
357
+ THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
358
+ IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
359
+ FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
360
+ AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
361
+ LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
362
+ OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
363
+ SOFTWARE.
364
+
365
+ ---