Python developer toolkit for code safety and health
Project description
codryx
codryx is a lightweight Python code quality and dependency health toolkit that helps you maintain clean, secure, and healthy codebases through progressive feature phases
โจ Features
- ๐ Guarded Function Contracts โ Strict mode enforcement for function contracts
- ๐ Dead Code Detection โ Unused imports, variables, and symbols
- ๐ฆ Dependency Scanning โ Security vulnerabilities and license compliance
- ๐ค Migration PR Automation โ Auto-merge support for GitHub/GitLab
- ๐ License Management โ License graph visualization and gatekeeper scoring
- ๐ Interactive Dashboards โ Real-time CI dashboards with WebSocket broadcasting
- ๐ Rich Notifications โ Slack, Teams, and webhook integrations
- ๐ ๏ธ IDE Integration โ VSCode/PyCharm helpers and quickfixes
๐ Installation
Prerequisites
- Python 3.7 or higher
Setup
# Create virtual environment
python -m venv .venv
# Activate on Windows
.\\.venv\\Scripts\\activate
# Activate on macOS/Linux
source .venv/bin/activate
# Install optional dependencies for enhanced features
pip install typer rich requests pyyaml packaging jinja2 websockets
## ๐ฏ Quick Start
```bash
# View CLI help
python -m codryx.cli help
# Run health check
python -m codryx.cli doctor
# Run examples
python run_examples.py
๐ CLI Usage
| Command | Description |
|---|---|
python -m codryx.cli help |
Display help information |
codryx deps scan |
Scan dependencies |
codryx code scan --root . |
Scan codebase for issues |
codryx security scan |
Run security vulnerability scan |
codryx doctor |
Run comprehensive health check |
codryx strict |
Enable strict mode enforcement |
Note: Without Typer/Rich installed, use
python -m codryx.cli doctoras fallback.
๐ Python API
from codryx import guard, enable_strict_mode, scan_code, scan_dependencies
# Enable strict mode for function contracts
enable_strict_mode()
@guard
def critical_function(data):
"""This function is guarded by strict contracts"""
return process_data(data)
# Scan codebase for issues
issues = scan_code("./src")
# Scan dependencies
vulnerabilities = scan_dependencies()
โ๏ธ Environment Variables
| Variable | Description | Default |
|---|---|---|
PY_GUARDIAN_MODE |
Environment mode | "development" |
PY_GUARDIAN_STRICT |
Enable strict mode | "false" |
PY_GUARDIAN_REPORT_DIR |
Output directory | "reports" |
PY_GUARDIAN_AUDIT_ASYNC |
Enable async audit | "false" |
PY_GUARDIAN_AUDIT_QUEUE |
Queue size | "1024" |
PY_GUARDIAN_HEALTH_THRESHOLD |
Health gate threshold | "70" |
PY_GUARDIAN_LICENSE_BLOCKLIST |
Blocked licenses | "" |
PY_GUARDIAN_SLACK_WEBHOOK |
Slack webhook URL | "" |
PY_GUARDIAN_TEAMS_WEBHOOK |
Teams webhook URL | "" |
GITHUB_TOKEN / GITLAB_TOKEN |
VCS tokens | "" |
PY_GUARDIAN_APPROVED |
Auto-merge approval | "false" |
๐ Feature Roadmap
| Phase | Features |
|---|---|
| 1โ2 | Guard contracts, strict mode, dead code detection, dependency scanning |
| 3 | License graph/conflicts, gatekeeper, dashboards |
| 4 | Notifications, interactive charts, IDE hints |
| 5 | Rich notifications, real-time CI dashboard, security auto-remediation |
| 6 | IDE extension modules, WebSocket broadcaster, pipeline snippets |
๐ก Examples
IDE Integration
examples/ide_preview.pyโ Guard highlights and health hintsexamples/vscode_plugin_example.pyโ VSCode diagnostics and quickfix
Dashboards
# Generate metrics dashboard
python examples/ci_dashboard_example.py
# Open reports/ci_dashboard.html
Notifications
examples/notifications_example.pyโ Simple webhook integrationexamples/notifications_rich_example.pyโ Slack/Teams rich payloads
Security
examples/security_pipeline_example.pyโ CI pipeline security snippets
โ Verifying Installation
# 1. Activate virtual environment
.\.venv\Scripts\activate
# 2. Test CLI commands
python -m codryx.cli help
python -m codryx.cli doctor
# 3. Run examples
python run_examples.py
# 4. Run tests
python -m unittest discover -s tests -p "test*.py" -q
๐ง Optional Modules
| Module | Path | Requirements |
|---|---|---|
| IDE Extensions | codryx/ide_ext/ |
VSCode, PyCharm |
| Real-time CI | codryx/ci_realtime.py |
websockets |
| Rich Notifications | codryx/notifications_rich.py |
rich, requests |
| Security Remediation | codryx/security_remediation.py |
requests |
๐ Project Structure
codryx/
โโโ codryx/ # Main package
โโโ examples/ # Usage examples
โโโ tests/ # Unit tests
โโโ templates/ # Dashboard templates
โโโ reports/ # Generated reports
๐ค Contributing
Contributions are welcome! Please feel free to submit a Pull Request.
MIT License
Copyright (c) 2026 Muhammad Zaid Tahir
Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions:
The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software.
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
Built with โค๏ธ and โจ magic by M. Zaid
Making Python development magical, one utility at a time
โญ Star us on GitHub โ it motivates
Project details
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
Built Distribution
Filter files by name, interpreter, ABI, and platform.
If you're not sure about the file name format, learn more about wheel file names.
Copy a direct link to the current filters
File details
Details for the file codryx-0.1.3.tar.gz.
File metadata
- Download URL: codryx-0.1.3.tar.gz
- Upload date:
- Size: 28.2 kB
- Tags: Source
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/6.2.0 CPython/3.14.3
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
5f43462e07fa29b2c11f87bf44fece6211b4a95ec8e0097821552c86b2bd7df3
|
|
| MD5 |
7eabc185c19ab626adb3255cd986435a
|
|
| BLAKE2b-256 |
fc4fa38162f50e391185fcaac0e7b226642d4583088cc8eddb2931575c029e1c
|
File details
Details for the file codryx-0.1.3-py3-none-any.whl.
File metadata
- Download URL: codryx-0.1.3-py3-none-any.whl
- Upload date:
- Size: 33.9 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/6.2.0 CPython/3.14.3
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
f1813caf966aaee8f51bbb1a3cf2b77afd28108c4e156e367722c531d8ae9072
|
|
| MD5 |
fe94c3dd51f6f4b79ee66a6aa1fc5f9d
|
|
| BLAKE2b-256 |
67b6ad43f7060f8eeb5531cbf3d5aa3a2273117544ac216dadeeabd858f0516c
|