Metadata-Version: 2.4
Name: pikapackage
Version: 0.1.1
Summary: Python SDK and window helper for ZekeGPT
Author: Zeke Cheng
Requires-Python: >=3.8
Description-Content-Type: text/markdown
Requires-Dist: requests>=2.31.0
Dynamic: author
Dynamic: description
Dynamic: description-content-type
Dynamic: requires-dist
Dynamic: requires-python
Dynamic: summary

# pikapackage

`pikapackage` is a small Python package for developers who want to:

- create a simple Tkinter window
- call the ZekeGPT API for chat, image generation, and YouTube helpers
- build simple games with a lightweight built-in 2D engine

## Installation

```bash
pip install pikapackage==0.1.1
```

For local development from this repository:

```bash
pip install .
```

## Run tests

```bash
python -m unittest discover -s test
```

## Features

### AI client

```python
from pikapackage import AI

ai = AI(api_key="sk-xxxxx")

print(ai.chat("hello"))
image_b64 = ai.generate_image("roblox sword")
print(image_b64[:50])
print(ai.youtube_channel("Pika Studio"))
print(ai.youtube_video("https://www.youtube.com/watch?v=dQw4w9WgXcQ"))
```

Base URL:

`https://zekegpt.pikastudio.dpdns.org/devapi/v1`

Authentication header used by the client:

```python
headers = {
    "Authorization": f"Bearer {self.api_key}",
    "Content-Type": "application/json"
}
```

Handled API errors:

- `401` -> `Invalid API key`
- `429` -> `Rate limit exceeded`
- `500+` -> `Server error`

### Window helper

```python
from pikapackage import Window

app = Window("My App")
app.run()
```

### pygamezeroremake engine

```python
from pikapackage import pygamezeroremake

WIDTH = 800
HEIGHT = 600
player = pygamezeroremake.Actor("player", pos=(100, 100))

def update(dt):
    if keyboard.right:
        player.x += int(200 * dt)

def draw():
    player.draw()

pygamezeroremake.go(globals())
```

Included engine pieces:

- `Game` base class for subclass-style games
- `go(globals())` for pygame-zero-style module games
- `Actor`, `Rect`, `screen`, `keyboard`, and `clock`
- `Input` state with `is_down()`, `was_pressed()`, and `was_released()`
- `keys.LEFT`, `keys.RIGHT`, `keys.UP`, `keys.DOWN`, and more for input checks
- `screen.draw.text()`, `screen.draw.rect()`, `screen.draw.filled_rect()`, `screen.draw.circle()`, and `screen.draw.filled_circle()`
- `create_game(...)` for callback-style games
- `run(...)` as a compatibility shortcut for a blank window
- no dependency on the real `pygame`

## Full example

```python
from pikapackage import AI, Window

ai = AI(api_key="sk-xxxxx")

print(ai.chat("hello"))

img = ai.generate_image("roblox sword")
print(img[:50])

app = Window("My App")
app.run()
```

## Examples

Run any script from the project root:

```bash
python examples/chat_example.py
python examples/image_example.py
python examples/pygamezeroremake_example.py
python examples/youtube_example.py
python examples/window_example.py
```

## Package structure

```text
pikapackage/
├── examples/
│   ├── chat_example.py
│   ├── image_example.py
│   ├── pygamezeroremake_example.py
│   ├── youtube_example.py
│   └── window_example.py
├── pikapackage/
│   ├── __init__.py
│   ├── ai.py
│   ├── pygamezeroremake.py
│   └── window.py
├── test/
│   ├── __init__.py
│   ├── test_ai.py
│   ├── test_pygamezeroremake.py
│   └── test_window.py
├── README.md
└── setup.py
```
