semvec/pypi-packages huggingface dataset:
pycodebuddy 0.0.1
A command-line tool leveraging OpenAI's GPT for intelligent project management within a Git-integrated shell.
License: MIT
Requires Python: >=3.9
Keywords: GPT, automation, OpenAI, interactive shell, Git, project management

# Codebuddy

Codebuddy is an advanced command-line tool designed for executing user queries using OpenAI's GPT models within a Git-integrated shell environment. It provides intelligent automation of project file and configuration management, enabling efficient and dynamic interaction with projects.

## Table of Contents

- [Features](#features)
- [Installation](#installation)
- [Usage](#usage)
- [Architecture](#architecture)
- [Dependencies](#dependencies)
- [Development](#development)
- [Contributing](#contributing)
- [License](#license)

## Features

- **Interactive Shell**: Engage in an interactive shell environment with Git-based rollback capabilities to ensure safe modifications.
- **AI-Driven Query Processing**: Leverage OpenAI's GPT models to intelligently handle user queries and automate project management tasks.
- **Seamless File Management**: Facilitates project updates, file modifications, and configuration adjustments in response to user interactions.
- **Robust Command Execution**: Securely execute system commands as part of an integrated workflow.

## Installation

Codebuddy requires Python 3.8 or later. Install using Poetry with:

```bash
poetry install
```

## Usage

Enter the interactive shell or execute direct queries via:

```bash
poetry shell
codebuddy "<your request here>"
```

Ensure your OpenAI API key is configured as an environment variable.

## Architecture

Codebuddy features a robust, modular architecture:
- `main.py`: Serves as the entry point for the interactive shell and direct query execution.
- `openai_client.py`: Manages integration with the OpenAI API to process user queries and generate actionable responses.
- `file_handler.py`: Handles dynamic file operations and manages project files.
- `command_executor.py`: Facilitates execution of system commands with necessary checks.
- `transaction_handler.py`: Provides Git-based transaction management to aid in safe rollbacks.

## Dependencies

Managed via Poetry and specified within `pyproject.toml`. Key dependencies include:
- openai
- PyYAML

## Development

Install additional development tools using:

```bash
poetry install --with dev
```

Use `black` for formatting, `flake8` for style checks, `mypy` for type checks, and `isort` for organizing imports.

## Contributing

Contributions are encouraged. Fork, implement improvements, and submit a pull request with test coverage for new features.

## License

Licensed under MIT License. See [LICENSE](LICENSE) for more information.
pymediator 0.3.0
Lightweight and extensible implementation of the Mediator pattern in Python
License: MIT
Requires Python: <4.0,>=3.10

# Pymediator

[![downloads](https://img.shields.io/pypi/dm/django-smooth-migrations.svg)](https://pypistats.org/packages/pymediator)
[![versions](https://img.shields.io/pypi/pyversions/pymediator.svg)](https://pypi.python.org/pypi/pymediator)
[![license](https://img.shields.io/github/license/serivt/pymediator.svg)](https://github.com/serivt/pymediator/blob/master/LICENSE)

Provides a lightweight and extensible implementation of the Mediator pattern in Python, specifically designed for systems that follow the CQRS (Command Query Responsibility Segregation) pattern. Its architecture allows for a clear separation of command and query logic, making it ideal for clean architectures and event-driven systems.

## Install
```bash
pip install pymediator
```

# Usage
```python
from dataclases import dataclass
from pymediator import Mediator as _Mediator, SingletonRegistry

registry: SingletonRegistry = SingletonRegistry()

@dataclass
class SumRequest:
    x: int | float
    y: int | float

class SumHandler:
    def handle(self, request: SumRequest) -> int | float:
        return request.x + request.y

registry.register(SumRequest, SumHandler)

class Mediator(_Mediator):
    def __init__(self) -> None:
        super().__init__(registry=SingletonRegistry())

mediator: Mediator = Mediator()

mediator.send(SumRequest(x=3, y=8)) # Output: 11
```

## Recommended use
```python
# my_app/application/queries/sum.py
from dataclases import dataclass

@dataclass
class SumRequest:
    x: int | float
    y: int | float

class SumHandler:
    def handle(self, request: SumRequest) -> int | float:
        return request.x + request.y
```

```python
# my_app/infrastructure/mediator.py
from pymediator import SingletonRegistry
from my_app.application.queries.sum import SumRequest, SumHandler

registry: SingletonRegistry = SingletonRegistry()

registry.register(SumRequest, SumHandler)
```

```python
# my_app/infrastructure/console.py
import sys
from my_app.application.queries.sum import SumRequest

@inject
def main(x: int, y: int, mediator: Mediator = Provide[AppContainer.mediator]) -> None:
    print(mediator.send(SumRequest(x=x, y=y)))

if __name__ == "__main__":
    num1: int = int(sys.argv[1])
    num2: int = int(sys.argv[2])
    main(num1, num2)
```