Metadata-Version: 2.4
Name: pycoach-ai
Version: 0.1.1
Summary: An AI-powered Python learning and coding practice engine.
Requires-Python: >=3.10
Description-Content-Type: text/markdown
Requires-Dist: google-genai<3,>=2.13
Provides-Extra: dev
Requires-Dist: pytest>=9; extra == "dev"

# PyCoach

An AI-powered Python learning and coding practice engine.

PyCoach generates Python coding challenges, provides hints, runs submitted solutions against test cases, and gives you a score.

## Features

- AI-generated Python coding challenges
- Difficulty levels from 1 to 5
- Category-based challenges
- Progressive hints
- Automatic test execution
- Test-by-test scoring
- Runtime error reporting
- Execution timeout protection
- Gemini AI support
- Fake AI provider for development and testing

## Installation

Install the core package:

    pip install pycoach-ai

To enable Google Gemini:

    pip install "pycoach-ai[gemini]"

## Quick Start

Configure Gemini:

    pycoach setup

Then use PyCoach:

    import pycoach

    pycoach.set_difficulty(2)
    pycoach.set_category("lists")

    challenge = pycoach.start_challenge()

    print(challenge.prompt)
    print(challenge.hints)
    print(challenge.tests)

## Solving a Challenge

Write your solution:

    def count_even(numbers):
        return sum(1 for n in numbers if n % 2 == 0)

Then submit it:

    result = challenge.submit(count_even)

    print(result.passed)
    print(result.score)
    print(result.summary())

You can also submit source code directly:

    code = """
    def count_even(numbers):
        return sum(1 for n in numbers if n % 2 == 0)
    """

    result = challenge.run(code)

    print(result.summary())

## Development

Install the development dependencies:

    pip install -e ".[dev,gemini]"

Run the test suite:

    pytest

## License

MIT
