Zelepy
Zelepy is a Python wrapper for the Zelesis Neo API, allowing you to communicate with the Zelesis Neo software from Python.
Installation
pip install zelepy
Features
- Event Listening: Listen for Neo events over UDP (detections, triggerbot, etc.)
- Command Broadcasting: Send commands to control Zelesis Neo (mouse movement, clicks, detection requests)
- Configuration Management: Read and write Zelesis Neo configuration files
- Helper Utilities: Get installation paths, versions, and image compression utilities
Quickstart
Zelesis Client
The Zelesis Client is used to broadcast or listen for events via UDP. It can be initialized via:
from zelepy.events import ZelesisClient
client = ZelesisClient()
client.start()
Remember when you are finished with the client to run
client.stop()
Or, you can simply use the client like a context manager, which will not require you to stpo the client once you are finished with it:
from zelepy.events import ZelesisClient
with ZelesisClient() as client:
print(f"Client is running: {client.is_running}")
When initializing you can set options:
from zelepy.events import ZelesisClient
client = ZelesisClient(
receive_port: int = 26512, # Port to listen for events
send_port: int = 26513, # Port to send commands
target_ip: str = "127.0.0.1", # IP address of Zelesis Neo
timeout: float = 2.0 # Command response timeout (seconds)
)
Event Listening
from zelepy.events import ZelesisClient
import time
def on_detection(event):
print(f"Detection: {event}")
def on_triggerbot(event):
print(f"Triggerbot: {event}")
def on_any_event(event):
print(f"Recieved an event: {event}")
with ZelesisClient() as client:
# You can subscribe to specific events
client.subscribe("detection", on_detection)
client.subscribe("triggerbot", on_triggerbot)
# Or you can create a generic listener that will be called whenever ANY event is received
client.add_event_listener(on_any_event)
while True:
time.sleep(0.01)
Event Broadcasting
Mouse Functions
from zelepy.events import ZelesisClient
with ZelesisClient() as client:
# No need to run client.start() here as its being used as a context manager
# Move mouse by x, y pixels. Note that this is relative to its current position, rather than moving to an absolute position on screen
client.move_mouse(100, 50)
# Left click the mouse
client.click_mouse()
Requesting Detections
There are 2 ways to get Zelesis to run detections for you. You can either provide an image path:
from zelepy.events import ZelesisClient
with ZelesisClient() as client:
result = client.request_detection("image.png")
or you can provide the raw image bytes:
from zelepy.events import ZelesisClient
with open("your_image.jpg", "rb") as f:
image_bytes = f.read()
with ZelesisClient() as client:
request_detection_raw(image_bytes)
Please NOTE that since events are sent around over UDP, the maximum file size, or image bytes size for both methods is approximately 40-50kb. There is a helpful function in zelepy.helpers to help minimise your image size to fit the constraints:
import zelepy.helpers as helpers
compressed_bytes, info = helpers.compress_image_to_target_size("image.png", target_kb=50)
print(f"Compressed from {info.original_size_kb:.1f}KB to {info.final_size_kb:.1f}KB")
print(f"Success: {info.success}, Quality: {info.quality}")
Note that compress_image_to_target_size returns the compressed bytes, and a CompressionInfo object.
Metadata
Release files for zelepy 0.0.5
For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.
Source distribution (sdist)
| File | Size | Uploaded | |
|---|---|---|---|
| zelepy-0.0.5.tar.gz | 13.7 kB | Details |
Built distribution (wheel)
| File | Interpreter | ABI | Platform | Reset |
|---|---|---|---|---|
| zelepy-0.0.5-py3-none-any.whl | Python 3 | none | any | Details |
Total release size: 27.2 kB
Release files / zelepy-0.0.5.tar.gz
| Download URL | zelepy-0.0.5.tar.gz |
|---|---|
| Size | 13.7 kB |
| Tags | Source |
|
SHA-256 checksum How to use checksums |
0376ff21b9621b49c091df272413eecd467618cc005bf1904eb21f21088297f9
|
|
BLAKE2b-256 checksum How to use checksums |
00ec395826112b39864f2b8b60d40206bdfca8ccf8bdf38da9a2c96026a96862
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
twine/6.2.0 CPython/3.12.6
|
Release files / zelepy-0.0.5-py3-none-any.whl
| Download URL | zelepy-0.0.5-py3-none-any.whl |
|---|---|
| Size | 13.5 kB |
| Tags | Python 3 |
|
SHA-256 checksum How to use checksums |
4e414143d26d6c2970c57459a5cb0cb8bcbda8e251bdc5021ff438eac69315e1
|
|
BLAKE2b-256 checksum How to use checksums |
679faf5afdccd04492cc231421a40089ab2edd56724b4ed9566692fc019ca25f
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
twine/6.2.0 CPython/3.12.6
|