skillfed

PyWinBox

Cross-Platform and multi-monitor toolkit to handle rectangular areas and windows box

pywinbox v0.7 199.6K downloads/30d#9,706 on PyPI1
Permissive license BSD 3 Active released

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 pywinbox

uv

uv add pywinbox

poetry

poetry add pywinbox

Installing 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

Development Status :: 4 - BetaEnvironment :: MacOS XEnvironment :: Win32 (MS Windows)Environment :: X11 ApplicationsIntended Audience :: DevelopersLicense :: OSI Approved :: BSD LicenseOperating System :: OS IndependentProgramming Language :: PythonProgramming Language :: Python :: 3Programming Language :: Python :: 3 :: OnlyProgramming Language :: Python :: 3.10Programming Language :: Python :: 3.11Programming Language :: Python :: 3.9

Tags

cross-platform window positioningget set window size positionrectangular area managementmulti-monitor window controlwindow geometry properties
window-managementcross-platformdesktop-automation

More Software Development packages