semvec/pypi-packages huggingface dataset:
Ranjan-pattern-printing 0.1.0
This is used to print package
Requires Python: >=3.6

# Pattern

This is simple package to print patterns

# Installation

Install it using pip:

pip install Ranjan_pattern_printing

from pattern import (pyramid,right_angle,left_angle)

# pyramid

pyramid(5)

    * 
   * *
  * * *
 * * * *
* * * * *
Shalinee-pattern-package 0.1.0
This package is for printing patterns
Requires Python: >=3.6

# Pattern

This is a simple package to print the patterns

# Installation

Install it using pip

pip install Shalinee_pattern_package

from pattern import (pyramid,right_angle,left_angle)

# pyramid
pyramid(5)
# output

    *
   * *
  * * *
 * * * *
* * * * *
Susmita-Pattern-printing 0.1.1
This package contains  differnt functions for  patterns
Requires Python: >=3.6

# pattern_pack
This a simple package to print a patterns

## Installation

Install it using pip:

pip install Susmita_Pattern_printing

from pattern_pack import (pyramid,right_angle,left_angle)


# pyramid
pyramid(5)

# output
    * 
   * * 
  * * * 
 * * * * 
* * * * * 

# right_angle

right_angle(4)

# output

*
**
***
****

# left_angle

left_angle(4)

# output

  *
 **
***
soga-api 0.1.0
A Python library that encapsulates AI model APIs
Requires Python: >=3.12

# soga-api

soga-api是一个封装了大模型相关接口的Python库，提供了统一的API来调用不同的AI供应商（如OpenAI、Google等）的服务。

## 特性

- 统一的API接口，简化AI模型调用
- 支持多种AI供应商（OpenAI、Google、Ollama等）
- 可扩展的架构，易于添加新的供应商和协议
- 强类型支持，提高代码健壮性
- 灵活的供应商配置，支持动态添加供应商
- 支持文本生成和图像生成功能
- 图像自动生成并保存到文件
- 简化的API密钥配置方式

## 安装

```bash
pip install soga-api
```

## 快速开始

首先设置环境变量：

```bash
export OPENAI_API_KEY="your-openai-api-key"
export GOOGLE_API_KEY="your-google-api-key"
```

然后在代码中使用：

```python
from soga_api import Client

# 创建客户端实例（API密钥从环境变量自动读取）
client = Client()

# 或者直接在代码中提供API密钥
# client = Client(
#     openai_api_key="your-openai-api-key",
#     google_api_key="your-google-api-key"
# )

# 使用默认供应商进行文本到文本转换
result = client.text_to_text("Translate the following English text to French: 'Hello, how are you?'")
print(result)

# 使用默认供应商进行文本到图像转换（图像会自动保存到文件）
image_path = client.text_to_image("A beautiful sunset over the ocean")
print(f"Image saved to: {image_path}")

# 指定特定供应商调用
result = client.text_to_text("Summarize this article", provider="google")

# 使用Ollama本地模型
result = client.text_to_text("Explain quantum computing in simple terms", provider="ollama")

# 使用自定义参数调用
result = client.text_to_text(
    "Write a short poem about technology",
    provider="openai",
    model="gpt-4o-mini",
    temperature=0.5,
    max_tokens=500
)
```

## 使用Google图像生成

soga-api支持使用Google的原生图像生成功能，生成的图像会自动保存到文件：

```python
from soga_api import Client

client = Client()

# 生成图像（自动保存到文件）
image_path = client.text_to_image(
    "A beautiful sunset over a futuristic city with flying cars",
    provider="google"
)

print(f"Image saved to: {image_path}")
```

## 使用Ollama

要使用Ollama本地模型，需要先安装Ollama并拉取模型：

```bash
# 安装Ollama
curl -fsSL https://ollama.com/install.sh | sh

# 拉取gemma3模型
ollama run gemma3:1b
```

Ollama默认在`http://localhost:11434`运行，soga-api已经配置好通过OpenAI兼容API与Ollama通信。

## 动态添加供应商

soga-api支持动态添加新的供应商：

```python
from soga_api import Client, ProviderConfig

client = Client()

# 添加自定义供应商配置
custom_config = ProviderConfig(
    base_url="https://custom-api.example.com/v1",
    api_key="your-custom-key",
    default_models={
        "text_to_text": "custom-model-v1",
        "text_to_image": "custom-image-model-v1"
    },
    supported_protocols=["text_to_text", "text_to_image"]
)

# 添加供应商并指定使用的协议实现
client.add_provider("custom", custom_config, "openai")  # 使用OpenAI协议实现
```

## 开发

### 安装依赖

```bash
uv sync
```

### 运行测试

```bash
uv run pytest tests/
```

### 运行示例

```bash
# 运行基本使用示例
export OPENAI_API_KEY="your-openai-api-key"
export GOOGLE_API_KEY="your-google-api-key"
uv run python examples/basic_usage.py

# 运行Google图像生成示例
export GOOGLE_API_KEY="your-google-api-key"
uv run python examples/google_image_generation.py

# 运行动态添加供应商示例
uv run python examples/dynamic_provider.py
```