PyWinBox
Cross-Platform and multi-monitor toolkit to handle rectangular areas and windows box
What it is and what it does
PyWinBox is a cross-platform library for querying and manipulating window geometry—position, size, and derived properties like center, corners, and midpoints. It abstracts the differences between Windows (via pywin32), macOS (via pyobjc), and Linux (via python-xlib and ewmhlib), letting you read and set window bounds using a uniform API.
You instantiate a PyWinBox object with a window handle (in the appropriate format for your OS) and optional callback functions. The library then exposes properties like left, top, right, bottom, width, height, center, topleft, bottomright, and others, plus utility structs (Box, Rect, Size, Point) for cleaner data handling. You can use default callbacks to move and resize windows automatically, or provide custom callbacks to integrate with your own window management logic.
Use it for:
- Programmatically position and resize application windows on multi-monitor setups.
- Track or enforce window geometry constraints in a cross-platform desktop tool.
- Build custom window tiling or layout managers that work on Windows, macOS, and Linux.
- Retrieve current window bounds for logging, testing, or UI automation workflows.
- Manage rectangular areas with custom data backends by providing your own callbacks.
Worth the install?
AI-flagged interpretation of the facts on this page — verify before relying
PyWinBox manages window positions, sizes, and rectangular areas across Windows, macOS, and Linux, exposing properties like left, top, width, height, center, and corner coordinates.
Yes, if you need cross-platform window geometry control. The library is actively maintained, has low install friction, and covers all three major desktop OSes. The permissive BSD license poses no barrier. Start with the default callbacks for simple use cases; define custom ones only if you need to integrate with existing window management. No known vulnerabilities.
Install
pywinbox on PyPI
pip
pip install pywinboxuv
uv add pywinboxpoetry
poetry add pywinboxInstalling PyWinBox
Before you install
Low install friction with a pure-Python wheel. Maintenance is active with a recent commit on 2026-07-15. The package depends on platform-specific libraries (pywin32 for Windows, pyobjc for macOS, python-xlib and ewmhlib for Linux), which install cleanly but tie you to those ecosystems.
License in practice
BSD 3 is a permissive license, so you can use this in commercial and private projects with minimal restrictions—just include the license text.
Quickstart
pip install pywinbox
import pywinbox
# For a window handle (platform-specific format)
myBox = pywinbox.PyWinBox(onQuery=None, onSet=None, handle=windowHandle)
print(myBox.left, myBox.top, myBox.width, myBox.height)
Requires platform-specific window handle: integer/string on Windows, integer/X-Window on Linux, or NSWindow/app+title tuple on macOS.
Verify before relying
- Whether the package works reliably with all three platforms or if some have better support than others.
- Performance characteristics when managing many windows or frequent property updates.
- Compatibility with modern versions of pywin32, pyobjc, and python-xlib.
Package facts
| License | BSD 3 (permissive) |
| Python support | not specified |
| Install friction | low — pure-Python wheel |
| Runtime dependencies | 5 — typing-extensions, pyobjc, python-xlib, ewmhlib, pywin32 |
| Maintenance | actively maintained — 849 days since the last release |
| Last repo commit | |
| First released | |
| Downloads | 199,558/month — #9,706 on PyPI (30-day window, as of 2026-08-14) |
| Known vulnerabilities | none known (OSV.dev, checked 2026-08-14) |
Evidence: PyWinBox-0.7-py3-none-any.whl
Keywords: left, top, right, bottom, size, width, height, topleft, bottomleft, topright, bottomright, midtop, midleft, midbottom, midright, center, centerx, centery, box, rect, boundingbox, area
Tags
More Software Development packages
Provides backported and experimental type hints…
permissive · top 100 on PyPI
numpyNumPy provides an N-dimensional array object…
permissive · top 100 on PyPI
fastapiFastAPI is a Python web framework for building…
permissive · top 100 on PyPI
annotated-docProvides a way to document function parameters,…
permissive · top 100 on PyPI
typerTyper builds command-line applications from…
permissive · top 1,000 on PyPI
distlibDistlib provides low-level packaging utilities…
permissive · top 1,000 on PyPI
PyMonCtlPyMonCtl provides cross-platform Python access…
permissive · top 15,000 on PyPI
PyRectPyRect provides a Rect class for representing…
permissive · top 5,000 on PyPI
EWMHlibQuery and control window managers that…
permissive · top 15,000 on PyPI
wmctrlwmctrl provides programmatic control over…
permissive · top 15,000 on PyPI
PyGetWindowPyGetWindow provides functions to query,…
permissive · top 5,000 on PyPI
PyAutoGUIPyAutoGUI programmatically controls the mouse…
permissive · top 5,000 on PyPI
screeninfoDetects and reports the location, dimensions,…
permissive · top 5,000 on PyPI
pybboxesConverts between bounding box formats (COCO,…
permissive · top 15,000 on PyPI
PyMsgBoxPyMsgBox provides JavaScript-like message box…
copyleft · top 5,000 on PyPI
rectpackRectpack solves the 2D bin packing problem by…
permissive · top 15,000 on PyPI