Travis Vasceannie vasceannie
  • Joined on 2025-08-26

claude-scripts (0.1.4)

Published 2025-11-22 08:27:30 +00:00 by vasceannie in vasceannie/claude-scripts

Installation

pip install --index-url  --extra-index-url https://pypi.org/simple claude-scripts

About this package

A comprehensive Python code quality analysis toolkit for detecting duplicates, complexity metrics, and modernization opportunities

Claude Scripts - Code Quality Analysis Toolkit

A comprehensive Python code quality analysis toolkit for detecting duplicates, complexity metrics, and modernization opportunities.

Features

  • Duplicate Detection: Find similar code patterns across your codebase using advanced similarity algorithms
  • Complexity Analysis: Calculate cyclomatic complexity, maintainability index, and other code metrics
  • Modernization Analysis: Identify opportunities to modernize Python code patterns and syntax
  • Code Smells Detection: Detect common code smells and anti-patterns
  • Multiple Output Formats: Support for JSON, console, and CSV output formats
  • Comprehensive Reports: Full analysis reports with quality scores and recommendations

Installation

By default the package is published to a private Gitea mirror. Install it via:

pip install --index-url https://git.sidepiece.rip/api/packages/vasceannie/pypi claude-scripts==0.1.1

If you need a PyPI fallback, append --extra-index-url https://pypi.org/simple.

Usage

Command Line Interface

The package provides a claude-quality command with several subcommands:

Duplicate Detection

claude-quality duplicates src/ --threshold 0.8 --format console

Complexity Analysis

claude-quality complexity src/ --threshold 10 --format json

Modernization Analysis

claude-quality modernization src/ --include-type-hints --format console

Full Analysis

claude-quality full-analysis src/ --format json --output report.json

Install Claude Code Hook

After installing the package, configure the Claude Code quality hook for your project:

python -m quality.hooks.install --project . --create-alias

# Or via the packaged CLI entry-point
claude-quality-hook-install --project . --create-alias

This command writes .claude/settings.json, adds a helper script at .claude/configure-quality.sh, and registers the hook with Claude Code using python3 -m quality.hooks.cli.

Configuration

Create a configuration file to customize analysis parameters:

claude-quality create-exceptions-template --output-path .quality-exceptions.yaml

Use the configuration file:

claude-quality --config config.yaml --exceptions-file .quality-exceptions.yaml duplicates src/

Command Reference

Global Options

  • --config, -c: Path to configuration file
  • --exceptions-file, -e: Path to exceptions configuration file
  • --verbose, -v: Enable verbose output

Duplicates Command

claude-quality duplicates [OPTIONS] PATHS...

Options:

  • --threshold, -t: Similarity threshold (0.0-1.0, default: 0.8)
  • --min-lines: Minimum lines for duplicate detection (default: 5)
  • --min-tokens: Minimum tokens for duplicate detection (default: 50)
  • --output, -o: Output file for results
  • --format: Output format (json/console/csv, default: json)

Complexity Command

claude-quality complexity [OPTIONS] PATHS...

Options:

  • --threshold: Complexity threshold (default: 10)
  • --output, -o: Output file for results
  • --format: Output format (json/console, default: json)

Modernization Command

claude-quality modernization [OPTIONS] PATHS...

Options:

  • --include-type-hints: Include missing type hint analysis
  • --pydantic-only: Only analyze Pydantic patterns
  • --output, -o: Output file for results
  • --format: Output format (json/console, default: json)

Full Analysis Command

claude-quality full-analysis [OPTIONS] PATHS...

Options:

  • --output, -o: Output file for results
  • --format: Output format (json/console, default: json)

Requirements

  • Python ≥ 3.12
  • Dependencies: click, pyyaml, pydantic, radon

Development

Install development dependencies:

pip install claude-scripts[dev]

License

MIT License - see LICENSE file for details.

Contributing

This is a personal project. Please report issues or suggestions through the repository's issue tracker.

Requirements

Requires Python: >=3.12
Details
PyPI
2025-11-22 08:27:30 +00:00
3
MIT License Copyright (c) 2024 Your Name 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.
379 KiB
Assets (2)
Versions (5) View all
0.1.4 2025-11-22
0.1.3 2025-11-22
0.1.2 2025-10-26
0.1.1 2025-10-26
0.1.0 2025-08-26