Collection of AI-powered Python development tools designed to enhance your development workflow.
AI-powered semantic code search using OpenAI embeddings.
Features:
- Natural language code search (e.g., "function that validates email addresses")
- Finds semantically similar code, not just keyword matches
- Caches embeddings for fast repeated searches
- Supports Python, JavaScript, TypeScript, Java, C++, Go, Rust
Usage:
python semantic_search.py "your search query"Requirements:
- OpenAI API key in environment variable
OPENAI_API_KEY - Python packages:
openai,numpy
Examples:
# Find authentication logic
python semantic_search.py "user authentication and login"
# Find error handling
python semantic_search.py "exception handling and error recovery"
# Find API endpoints
python semantic_search.py "REST API routes and handlers"Intelligent test runner that automatically finds and runs relevant tests based on your code changes.
Features:
- Detects changed files in your Git repository
- Uses AI to identify related test files
- Automatically runs only relevant tests
- Supports pytest, unittest, and other Python test frameworks
- Falls back to running all tests if no changes detected
Usage:
# Run tests for changed files
python smart_test.py
# Specify custom test directory
python smart_test.py --test-dir tests/
# Force run all tests
python smart_test.py --allRequirements:
- OpenAI API key in environment variable
OPENAI_API_KEY - Python packages:
openai,pytest(or your preferred test runner) - Git repository
How it works:
- Detects uncommitted/unstaged changes in Git
- Uses AI to determine which test files are relevant
- Runs only those specific tests
- Shows clear results and saves time
- Clone this repository:
git clone https://github.com/Akhetonics/python-dev-tools.git
cd python-dev-tools- Install required packages:
pip install openai numpy pytest- Set your OpenAI API key:
export OPENAI_API_KEY="your-api-key-here"- Run the tools:
python semantic_search.py "your query"
python smart_test.pyThese tools can be integrated into your CI/CD pipeline:
GitHub Actions example:
- name: Run smart tests
env:
OPENAI_API_KEY: ${{ secrets.OPENAI_API_KEY }}
run: python smart_test.pyThese tools are designed to work seamlessly with the Autonomous Issue Agent, which can automatically use them to:
- Search codebases semantically when implementing features
- Run only relevant tests after making changes
- Improve development efficiency
MIT License - see LICENSE file for details
Contributions welcome! Please open an issue or pull request.
See Releases for version history.