screeninfo
Fetch location and size of physical screens.
What it is and what it does
screeninfo is a cross-platform library that queries the operating system to enumerate connected monitors and retrieve their physical properties: position (x, y coordinates), resolution (width and height in pixels), physical dimensions (width_mm, height_mm), display name, and primary-display status. It abstracts away platform differences by providing a single `get_monitors()` function that works on Windows, Linux (X11 and experimental DRM), macOS, and Cygwin.
The library is lightweight and has low install friction—it ships as a pure-Python wheel on most platforms. Its runtime dependencies include Cython and pyobjc-framework-Cocoa (macOS only), plus the dataclasses backport for older Python versions. It supports Python 3.6.2 through 3.9 officially, though classifiers indicate 3.10 support. You can also force a specific driver (windows, cygwin, x11, osx) if auto-detection fails or you need to override the environment.
Use it for:
- Detect monitor count and resolution to scale UI layouts or window positioning in desktop applications
- Query physical screen dimensions (mm) for DPI-aware rendering or accessibility adjustments
- Enumerate all connected displays to identify the primary monitor or arrange multi-monitor workflows
- Force a specific display driver when running in emulated or non-standard environments like Cygwin
- Retrieve monitor coordinates to place windows on specific screens in multi-display setups
Worth the install?
AI-flagged interpretation of the facts on this page — verify before relying
Detects and reports the location, dimensions, and physical properties of connected monitors across Windows, Linux, macOS, and Cygwin environments.
Yes, if you need cross-platform monitor detection for desktop or multi-display applications. The library is stable, permissively licensed, and has low install friction. However, maintenance is aging (last release 2022, no updates since August 2025)—verify that DRM support on Linux and compatibility with your target Python versions meet your needs before relying on it for production systems.
Install
screeninfo on PyPI
pip
pip install screeninfouv
uv add screeninfopoetry
poetry add screeninfoInstalling screeninfo
Before you install
Low friction installation with a pure-Python wheel. Maintenance is aging—last release was in 2022 and the repository has not been updated since August 2025, though it remains active and unarchived with modest community engagement (244 stars).
License in practice
MIT license permits commercial and private use with minimal restrictions; you must include a copy of the license and copyright notice in distributions.
Quickstart
pip install screeninfo
from screeninfo import get_monitors
for m in get_monitors():
print(m)
Platform-specific: requires X11 libraries on Linux (Xinerama), AppKit on macOS (via pyobjc-framework-Cocoa), or native Windows APIs. DRM support on Linux is experimental.
Verify before relying
- Whether DRM driver on Linux is stable enough for production use
- Current compatibility with Python 3.10+ beyond stated support
- Whether aging maintenance affects bug fixes for newer OS versions
Package facts
| License | MIT (permissive) |
| Python support | supports the current Python release (>=3.6.2,<4.0.0) |
| Install friction | low — pure-Python wheel |
| Runtime dependencies | 3 — dataclasses, Cython, pyobjc-framework-Cocoa |
| Maintenance | aging — 1,435 days since the last release |
| Last repo commit | |
| First released | |
| Downloads | 12,716,034/month — #1,309 on PyPI (30-day window, as of 2026-08-14) |
| Known vulnerabilities | none known (OSV.dev, checked 2026-08-14) |
Evidence: screeninfo-0.8.1-py3-none-any.whl
Tags
More Desktop Environment packages
Wraps any iterable to display a real-time…
copyleft · top 100 on PyPI
jeepneyJeepney is a pure Python implementation of…
permissive · top 1,000 on PyPI
progressbar2progressbar2 renders text-based progress bars…
permissive · top 5,000 on PyPI
shtabGenerates shell tab completion scripts for…
copyleft · top 5,000 on PyPI
pytest-qtpytest-qt is a pytest plugin that provides…
permissive · top 5,000 on PyPI
dbus-nextA pure-Python DBus library for Linux desktop…
permissive · top 15,000 on PyPI
archspecArchspec provides APIs to detect, query, and…
permissive · top 15,000 on PyPI
mssCaptures screenshots from one or all monitors…
permissive · top 5,000 on PyPI
PyMonCtlPyMonCtl provides cross-platform Python access…
permissive · top 15,000 on PyPI
PyWinBoxPyWinBox manages window positions, sizes, and…
permissive · top 15,000 on PyPI
PyGetWindowPyGetWindow provides functions to query,…
permissive · top 5,000 on PyPI
EWMHlibQuery and control window managers that…
permissive · top 15,000 on PyPI
PyScreezePyScreeze captures screenshots and locates…
permissive · top 5,000 on PyPI
PyAutoGUIPyAutoGUI programmatically controls the mouse…
permissive · top 5,000 on PyPI
xvfbwrapperManages headless X11 virtual displays using…
permissive · top 5,000 on PyPI
wakepyWakepy prevents a system from sleeping or…
permissive · top 15,000 on PyPI