Skip to main content

Python SDK and window helper for ZekeGPT

Project description

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

pip install pikapackage==0.1.1

For local development from this repository:

pip install .

Run tests

python -m unittest discover -s test

Features

AI client

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:

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

from pikapackage import Window

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

pygamezeroremake engine

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

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:

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

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

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

pikapackage-0.1.1.tar.gz (10.4 kB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

pikapackage-0.1.1-py3-none-any.whl (10.9 kB view details)

Uploaded Python 3

File details

Details for the file pikapackage-0.1.1.tar.gz.

File metadata

  • Download URL: pikapackage-0.1.1.tar.gz
  • Upload date:
  • Size: 10.4 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.2.0 CPython/3.14.0

File hashes

Hashes for pikapackage-0.1.1.tar.gz
Algorithm Hash digest
SHA256 9a6d127d979649036dae69ab0bedd9830d99b7527934c12fe42194c80350e4d6
MD5 b3c31d75504b468ea95ec1f6bf7ceb73
BLAKE2b-256 1df0fa6f7c9210da16614b7780c3e0eaaaabd2621ee50337731f237b79942cea

See more details on using hashes here.

File details

Details for the file pikapackage-0.1.1-py3-none-any.whl.

File metadata

  • Download URL: pikapackage-0.1.1-py3-none-any.whl
  • Upload date:
  • Size: 10.9 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.2.0 CPython/3.14.0

File hashes

Hashes for pikapackage-0.1.1-py3-none-any.whl
Algorithm Hash digest
SHA256 ef45444867b4b396f49e1851cc097565e4761d6b0b6aadf0c1698eb4fd64685f
MD5 92d864d365ae4f7d089b8e6642996105
BLAKE2b-256 1f95078caba49886a116b30211e193ddfbc65ae7247b86d7e1b10386914a1837

See more details on using hashes here.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Pingdom Monitoring Sentry Error logging StatusPage Status page