semvec/pypi-packages huggingface dataset:
screenshot-server 0.1.3
Add your description here
Requires Python: >=3.10

# 截图服务器

这个项目是一个截图服务器，使用Python编写。它提供了以下主要功能：

1. **截图功能**：通过调用`take_screenshot_image`工具，可以截取用户屏幕的截图，并将其返回为图像数据。
2. **图像处理**：使用Pillow库对截取的图像进行处理和显示。
3. **MCP服务器**：通过MCP协议与客户端进行通信，提供截图服务。

## 使用方法

1. 确保已安装Python和所需的依赖项。
```
$ uv sync
```
2. 运行`clint.py`文件，启动截图服务器。
```
$ uv run clint.py
```
3. 使用MCP客户端调用`take_screenshot_image`工具，获取屏幕截图。

## 依赖项

- Python 3.x
- Pillow库
- MCP协议相关库

## MCP配置
```
{
  "mcpServers": {
    "mcp-server": {
      "command": "/Users/username/.local/bin/uv",
      "args": [
        "--directory",
        "/Users/username/MCP",
        "run",
        "screenshot.py"
      ]
    }
  }
}
```

## 文件结构

- `screenshot.py`：提供截图功能的MCP服务器。
- `clint.py`：MCP客户端，用于调用截图服务器的工具。
- `README.md`：项目说明文档。
generic-consumer 0.20.2
A generic consumer for Python.
Requires Python: <4.0,>=3.8

# Generic Consumer

A flexible Python library for implementing consumer patterns with a focus on payload processing and queue management.

## Overview

Generic Consumer provides a framework for creating consumer classes that can process data payloads from various sources. It supports both synchronous and asynchronous processing with features like:

- Prioritized execution order
- Payload preprocessing
- Conditional activation
- Nested consumer hierarchies
- Robust error handling
- Customizable logging

## Installation

### Using pip

```bash
pip install generic-consumer
```

## Quick Start

```python
from generic_consumer import GenericConsumer

class MyConsumer(GenericConsumer):
    # Set the queue this consumer responds to
    @classmethod
    def queue_name(cls):
        return "my_queue"
    
    # Define where to get payloads from
    def get_payloads(self):
        return [1, 2, 3, 4, 5]
    
    # Process a single payload
    def process_one(self, payload):
        print(f"Processing: {payload}")
        
# Run all consumers for a queue
GenericConsumer.start("my_queue")
```

## Key Features

### Consumer Configuration

- **queue_name**: Define which queue a consumer belongs to
- **priority_number**: Set execution priority (lower numbers run first)
- **condition**: Determine whether a consumer should run based on runtime conditions
- **enabled**: Toggle consumer activation
- **process_empty_payloads**: Handle cases where no payloads are available
- **passive**: Create consumers that monitor but don't process (useful for logging)

### Processing Pipeline

1. **get_payloads**: Retrieve data to be processed
2. **payload_preprocessors**: Transform payloads before processing
3. **process**: Handle batch processing of all payloads
4. **process_one**: Process individual payloads

### Utility Methods

- **start_all/start**: Run all consumers for a given queue
- **print_available_consumers**: Display all registered consumers and their configurations
- **run**: Execute a specific consumer
- **run_all**: Execute all consumers

## Advanced Usage

### Passive Consumers

Use `PassiveConsumer` for monitoring or logging without modifying data:

```python
from generic_consumer import PassiveConsumer

class LoggingConsumer(PassiveConsumer):
    @classmethod
    def queue_name(cls):
        return "my_queue"
    
    def process(self, payloads):
        print(f"Observed {len(payloads)} items")
```