semvec/pypi-packages huggingface dataset:
light-dependency-injection 0.1.2
A lightweight dependency injection module for Python.
Requires Python: >=3.7

# LIGHT DI
## Dependency Injection Module for Python

LightDI is a lightweight, framework-agnostic dependency injection module for Python.

## Features

- Automatic dependency resolution
- Support for qualifiers
- Abstract class inference

## Usage
### Example 1: Basic Usage
```python
from abc import ABC, abstractmethod

from lightdi import implementation, inject


class PaymentProcessor(ABC):
    @abstractmethod
    def process_payment(self, amount: int) -> str:
        pass

@implementation(qualifier="credit_card")
class CreditCardProcessor(PaymentProcessor):
    def process_payment(self, amount: int) -> str:
        return f"Processed {amount} via Credit Card."

@implementation(qualifier="paypal", primary=True)
class PayPalProcessor(PaymentProcessor):
    def process_payment(self, amount: int) -> str:
        return f"Processed {amount} via PayPal."

class LogTransactionRepository(ABC):
    @abstractmethod
    def save(self, amount: int) -> None:
        pass

@implementation(qualifier="in_memory")
class InMemoryLogTransactionRepository(LogTransactionRepository):
    def save(self, amount: int):
        self._write_to_file(f"Transaction saved: {amount}")

    def _write_to_file(self, message) -> None:
        with open("transactions.txt", "a") as file:
            file.write(message + "\n")

@inject
class CheckoutService:
    def __init__(self, payment_processor: PaymentProcessor):
        self.payment_processor = payment_processor

    def checkout(self, amount) -> str:
        return self.payment_processor.process_payment(amount)

@inject
class PaymentController:
    def __init__(self, checkout_service: CheckoutService, log_transaction_repository: LogTransactionRepository):
        self.checkout_service = checkout_service
        self.log_transaction_repository = log_transaction_repository

    def process_checkout(self, amount) -> str:
        self.log_transaction_repository.save(amount)
        return self.checkout_service.checkout(amount)

if __name__ == "__main__":
    controller = PaymentController()
    print(controller.process_checkout(100))

```

### Example 2: Wire repositories to variables
```python
from abc import ABC, abstractmethod

from lightdi import implementation, wire


class LogRepository(ABC):
    @abstractmethod
    def log(self, message):
        pass

@implementation(qualifier="console")
class ConsoleLogRepository(LogRepository):
    def log(self, message):
        print(message)

@implementation(qualifier="timestamp", primary=True)
class TimeStampLogRepository(LogRepository):
    def log(self, message):
        print(f"{__import__('datetime').datetime.now()}: {message}")

if __name__ == "__main__":
    logger = wire(LogRepository)
    logger.log("message to be logged")

    console_logger = wire(LogRepository, qualifier="console")
    console_logger.log("message to be logged")

```

## Examples
- Example 1: Basic Usage | [link](examples/example_1.py)
- Example 2: Wire repositories to variable | [link](examples/example_2.py) 
- Example 3: Multi-file usage | [link](examples/example_3)
ortho-editor 0.1.14
ORTHO mask editor tool
Requires Python: >=3.6

# ORTHO Mask Editor

A PyQT5-based mask editor tool for the ORTHO (Old Research Text Hebrew OCR) project. This tool helps create training data for the ORTHO U-Net AI model by allowing users to create and edit image masks of Hebrew text documents.

## About ORTHO

ORTHO (Old Research Text Hebrew OCR) is a project focused on optical character recognition for historical Hebrew texts. The project uses a U-Net architecture for text segmentation and recognition.

## Screenshot

![ORTHO Mask Editor](docs/ortho-editor.png)

## Purpose

This mask editor serves as a crucial tool in the ORTHO pipeline by:

- Creating binary masks for training data
- Marking text regions in historical Hebrew documents
- Preparing ground truth data for the U-Net model
- Enabling manual correction of automated segmentation results

## Installation

### Prerequisites

- Python 3.6 or higher
- PyQt5
- NumPy

### Setup

You can install ORTHO Mask Editor using pip:

```bash
pip install ortho-editor
```

Or install from source:

1. Clone the repository:

```bash
git clone https://github.com/yaacov/ortho-editor.git
cd ortho-editor
```

## Usage

1. Prepare a directory that contains two subdirectories named `inputs` and `targets`.  
   - `inputs` holds the original images.  
   - `targets` holds the corresponding mask images (same filenames, same dimensions).

2. Install the required dependencies:
    ```bash
    pip install -r requirements.txt
    ```

3. Run the application:
    ```bash
    python main.py
    ```

4. When prompted, select your directory with `inputs` and `targets` subdirectories.  

5. A list of files from the `inputs` folder will appear. Choose a file to display the image as the background, then draw or edit the mask on top.

## Development

The project includes a Makefile with useful commands for development:

```bash
make install  # Install the required packages
make run      # Run the editor
make format   # Format the code using black
make lint     # Lint the code using flake8
make package  # Create a pip package
make push     # Upload package to PyPI using twine
make clean    # Remove build artifacts and Python cache files
```

If you're contributing to the project, make sure to run `make format` and `make lint` before submitting your changes.

## License

MIT License
sonos-artwork 1.3.2
Displays Sonos Artwork playing in a zone.  Allows for basic playback controls.
Requires Python: <4,>=3.10
Keywords: sonos

# Sonos Artwork

Displays Sonos artwork on a HyperPixel 4.0 Square.

Allows for basic playback controls, such as _Previous_, _Play/Pause_, _Next_.

Clicking in the middle of the screen display current track information.

## Requirements

The Sonos HTTP API running somewhere: https://github.com/jishi/node-sonos-http-api

## Limitations

Only work with Sonos Radio and Apple Music.