Skip to main content

AI Driven Python QA CLI

Project description

PyQAAI

 _____        ____                      _____ 
|  __ \      / __ \     /\        /\   |_   _|
| |__) |   _| |  | |   /  \      /  \    | |  
|  ___/ | | | |  | |  / /\ \    / /\ \   | |  
| |   | |_| | |__| | / ____ \  / ____ \ _| |_ 
|_|    \__, |\___\_\/_/    \_\/_/    \_\_____|
        __/ |                                 
        |___/     

PyQAAI (Python Quality Assurance AI) is a powerful, AI-driven command-line tool designed to automate and elevate the quality assurance process for Python code. It seamlessly integrates comprehensive code analysis through Abstract Syntax Tree (AST) inspections and SoTA LLM Inference, executes a tiered suite of automated QA checks, and generates detailed HTML reports. PyQAAI also offers intelligent code improvement suggestions, serving as a guided assistant to help you maintain high coding standards.

While this tool is invaluable for identifying potential issues and enhancing your code, it's important to treat its suggestions as potential guidance rather than definitive solutions. Use PyQAAI to catch overlooked details and inspire thoughtful improvements in your Python development projects.

Features

  • Automated Code Analysis: Utilises AST and a SoTA LLM to analyse your Python code for potential issues, best practices, and improvements.
  • Interactive CLI: Engage with a user-friendly command-line interface for seamless interaction.
  • Automatic Code Improvement Suggestions: Automatic Code Improvement Suggestions for any failing checks.
  • Report Generation: Generates detailed HTML reports based on the analysis.
  • Configuration: Add your OpenAI credentials and other settings with ease with a built in one-time setup process
  • Custom Prompt Mode: Leverage the intelligent assistant and integrated code analysis to perform any custom task.

Installation

To install PyQAAI, make sure you have Python >=3.10. You can install directly via pip package link:

pip install pyqaai

Or install the package directly from the repository:

git clone https://github.com/theaaviss/pyqaai.git
cd pyqaai
python3 -m build
pip install .

Usage

After installation, you can start using PyQAAI in any current working directory by running the following command in your terminal:

pyqaai

Initial Setup

The first time you run PyQAAI, you'll need to provide your OpenAI API key: If the API key is not set, you will be prompted to enter it. The key will be saved in a configuration file for future use.

Interactive Menu

When you run PyQAAI using the pyqaai command, you'll be guided through an intuitive interactive menu system designed to help you analyse your Python code efficiently.

1. Select a Python File

  • The tool starts by listing all Python files in the current working directory. You'll be prompted to select the file you want to analyse. If no Python files are found, the tool will notify you and exit.

2. Choose a Function or Class

  • After selecting a Python file, you will then choose a specific function or class from that file. The tool displays all available functions and classes, allowing you to target your analysis.

3. Select a Task

  • Once you've chosen a function or class, the tool will present you with the following task options:
    • Tier 1: Critical – Essential Checks, Bug Detection, and Security
    • Tier 2: Integrity – Testing, Code Quality, and Performance
    • Tier 3: Longevity – Documentation, Good Practice, and Maintainability
    • Custom Task: Tailored help via Intelligent Code Assistant

Each tier focuses on different aspects of code quality, ranging from critical issues to best practices for long-term maintenance.

4. Execution and Feedback

  • During the analysis, PyQAAI collects various details about the selected function or class, including:

    • The selected function or class itself
    • Import statements and the associated code
    • Invoked functions
    • Callers of the function or class
  • After selecting a task, the tool will execute the analysis. You will receive real-time feedback as the task runs, including progress updates and whether your code passes or fails the checks. The results are clearly indicated to help you understand areas that need improvement.

5. HTML Report Generation

  • Once the analysis is complete, PyQAAI automatically generates an HTML report. This report includes a summary of the analysis, detailed findings, and suggested code improvements. The report is saved for you and opened automatically to review or share.

Dependencies

PyQAAI relies on several Python packages:

  • openai - OpenAI API client
  • tqdm - Progress bar library
  • inquirer - Command-line interface library
  • termcolor - Colored terminal output
  • requests - HTTP requests library
  • markdown - Markdown to HTML converter

These dependencies are automatically installed when you install PyQAAI.

Contributing

Contributions are welcome! Please submit issues and pull requests via the GitHub repository.

License

This project is licensed under the MIT License. See the LICENSE file for details.

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

pyqaai-0.1.7.tar.gz (18.0 kB view details)

Uploaded Source

Built Distribution

pyqaai-0.1.7-py3-none-any.whl (18.8 kB view details)

Uploaded Python 3

File details

Details for the file pyqaai-0.1.7.tar.gz.

File metadata

  • Download URL: pyqaai-0.1.7.tar.gz
  • Upload date:
  • Size: 18.0 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/5.1.1 CPython/3.12.3

File hashes

Hashes for pyqaai-0.1.7.tar.gz
Algorithm Hash digest
SHA256 0b7855d527772ec57bb24068981e99114caa784a74d01f3b7c89cf8112715345
MD5 45a1cf75ffcaf38774b450114a43c3ac
BLAKE2b-256 976baacc91be85e1db5c9f79469eb6a8baddbeaab40b544917e275fc4d93c186

See more details on using hashes here.

File details

Details for the file pyqaai-0.1.7-py3-none-any.whl.

File metadata

  • Download URL: pyqaai-0.1.7-py3-none-any.whl
  • Upload date:
  • Size: 18.8 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/5.1.1 CPython/3.12.3

File hashes

Hashes for pyqaai-0.1.7-py3-none-any.whl
Algorithm Hash digest
SHA256 ded1aa542e8ec0f28696798f0952cc36c1e460e97af223dabcb61d9e3d57dee9
MD5 057407381d1252e8f63aab9536b47900
BLAKE2b-256 fbd936ca91386d9ca9c8dd2f4389008b75a7f271f06846c2d84b0cc4505feec1

See more details on using hashes here.

Supported by

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