zyto
Download an image from an HTTP(S) URL, open it with the default viewer — and on
Windows, run a tiny helper that shows a hello dialog.
pip install zyto
from zyto import download_and_open_image, show_hello
print(download_and_open_image("https://example.com/image.png"))
show_hello()
show_hello("hey you")
CLI
zyto hello
zyto hello "hey" -w
zyto image <url> --open
zyto info
zyto-hello
The helper
zyto/Helper.exe is compiled from helper/Helper.cs by
helper/build-helper.ps1 using the .NET Framework compiler that ships with
Windows. Its entire body is one MessageBoxW call:
MessageBoxW(IntPtr.Zero, text, "zyto", MB_OK | MB_ICONINFORMATION);
It is ~4 KB, unsigned-but-open-source, not packed, not encrypted, and it is run
in place from site-packages — no copy into %TEMP%, no obfuscation, no
network. Read the source, then read the binary; they match.
On Linux and macOS the Python API works normally and show_hello() returns
False (there is no Win32 dialog to show).
Build
# 1. compile the helper (needs only .NET Framework 4.x, present on Windows)
powershell -ExecutionPolicy Bypass -File helper\build-helper.ps1
# 2. build wheel + sdist
python -m build
By default pip install zyto is silent. If you want the dialog to also fire
once after install, build with the hook:
$env:ZYTO_HOOK = "1"
python tools\build.py # adds zyto.pth to the wheel
That variant runs zyto._hook.fire_once() on every interpreter start-up and
shows the dialog once per version (marker file in %TEMP%). Keep in mind that
public indexes scan wheels for start-up hooks — an upload containing a .pth
that spawns a process is very likely to be rejected or removed. The default
(no hook) build is the one that survives review.
API
download_image(url, output_path=None) | Download an image, return the saved path |
open_image(path) | Open a local file with the default viewer |
download_and_open_image(url, output_path=None) | Download + open → {file_path, opened} |
show_hello(text="hello", wait=False) | Run the helper dialog (Windows) |
has_helper() / helper_path() | Helper presence and path |
has_desktop_session() | True when a GUI is available |
Requires Python 3.8 or newer. MIT.