Skip to main content

Python developer toolkit for code safety and health

Project description

codryx

Codryx Logo

Status Python Version License

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 doctor as 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 hints
  • examples/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 integration
  • examples/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

codryx-0.1.3.tar.gz (28.2 kB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

codryx-0.1.3-py3-none-any.whl (33.9 kB view details)

Uploaded Python 3

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

Hashes for codryx-0.1.3.tar.gz
Algorithm Hash digest
SHA256 5f43462e07fa29b2c11f87bf44fece6211b4a95ec8e0097821552c86b2bd7df3
MD5 7eabc185c19ab626adb3255cd986435a
BLAKE2b-256 fc4fa38162f50e391185fcaac0e7b226642d4583088cc8eddb2931575c029e1c

See more details on using hashes here.

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

Hashes for codryx-0.1.3-py3-none-any.whl
Algorithm Hash digest
SHA256 f1813caf966aaee8f51bbb1a3cf2b77afd28108c4e156e367722c531d8ae9072
MD5 fe94c3dd51f6f4b79ee66a6aa1fc5f9d
BLAKE2b-256 67b6ad43f7060f8eeb5531cbf3d5aa3a2273117544ac216dadeeabd858f0516c

See more details on using hashes here.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Pingdom Monitoring Sentry Error logging StatusPage Status page