CLI tool
yinkaisheng/Python-UIAutomation-for-Windows avatar
yinkaisheng/Python-UIAutomation-for-Windows

uiautomation's first paragraph names two broken Python patch versions, and its packaging lists the same install script twice

🐍Python 3 wrapper of Microsoft UIAutomation. Support UIAutomation for MFC, WindowsForm, WPF, Modern UI(Metro UI), Qt, IE, Firefox, Chrome ...

3,591 stars579 forksPythonApache-2.0

At a glance

What is it?
uiautomation is a single-maintainer Python wrapper for the Windows UI Automation interface, supporting six generations of Windows and a list of application frameworks, with a two-line change in the 2.0 series that dropped Python 2 and added a dependency. Its readme warns that Python must run elevated, its packaging manifest lists the same console script twice, and its long description on the package index is one sentence.
Who is it for?
Use uiautomation if you are automating desktop Windows applications from Python and want one dependency that talks to the platform's own accessibility interface rather than to screen coordinates or window handles.
Can I use it commercially?
Yes. Apache-2.0 is a permissive licence: you can use, modify and sell software built on it, as long as you keep its copyright and licence notices.
Is it still maintained?
Yes. The repository last received commits 166 days ago.
What is it written in?
Mainly Python, according to GitHub's language statistics.

Answers come from the project's GitHub data, last synced on November 15, 2026, and from our analysis. They are not legal advice.

From daily snapshots

Star history

  • yinkaisheng/Python-UIAutomation-for-Windows3,591 ★ · +16
Star history
Repository2026-09-242026-11-15
yinkaisheng/Python-UIAutomation-for-Windows3.6k3.6k

16 Stars in the last 52 days, measured from the daily GitHub snapshot. Compare with other projects

Editorial analysis

Two exact interpreter patch versions are broken, and the readme says so first

The first substantive paragraph of the readme is a warning, and it is more specific than anything else in the file.

It names two exact interpreter patch releases and says not to use them, because the underlying type-binding dependency does not work in those two. It then tells you to install either an earlier version or the latest one, and links to the upstream issue.

That is an unusually honest opening. Most packages state a floor and leave you to discover the holes; this one states two specific points where its own floor is not enough.

The hole is in the binding library rather than in the wrapper, which is worth understanding before you plan around it. The wrapper calls into a Windows interface through a binding generated from the platform's type library, and a binding bug shows up as an import or attribute-access failure that looks like the wrapper's fault. Since the readme tells you to take the latest version as the workaround, the practical effect is that pinning your interpreter matters more than usual here.

The readme also explains what changed at the 2.0 boundary, which is the other version fact a user needs: the 1.x series supported both major versions of Python with no third-party dependencies at all, and 2.0 onward requires the third version and the binding.

The install script is listed twice in the packaging manifest

The packaging file has one line worth looking at, and it is short.

code
scripts=['scripts/automation.py', 'scripts/automation.py']

The same path appears twice in the list.

For a package that installs a console script, that list is what ends up in the interpreter's scripts directory on installation. Listing the same file twice means two identical commands on the user's path, or a build backend that silently deduplicates, depending on which installer runs.

It is harmless in effect and obvious in the file, and it is the kind of duplicate that survives because nobody reads that line after writing it once. Compare it with the neighbouring lines, which are careful: the dependency is pinned exactly on older interpreters and ranged on newer ones, and the typing backport is added only below the version where it became part of the standard library.

So the manifest has three conditional expressions and one repeated string, and the repeated string is the one that is wrong.

The readme says to run Python elevated, and that is a design decision

One sentence in the readme changes what your automation can be, and it is phrased as advice.

It says you should run Python as administrator, because otherwise the module may fail to enumerate controls or read their information on Windows 7 and later.

That is not a workaround for a bug. It is the consequence of how the platform's accessibility interface works: reading another process's controls requires crossing a privilege boundary, and a non-elevated process is refused.

So an automation built on this library runs with whatever rights you grant the interpreter. That is a real consideration for anything scheduled or service-hosted, because a process that must run elevated is a process that holds a token you would rather not hand to a script that is also reading untrusted document content.

The second platform caveat is the mirror image. On the two Windows versions where packaged applications run in their own shell, the readme says the application must be in the foreground, because once it is backgrounded its controls cannot be fetched at all.

Both caveats are stated in single sentences and neither is repeated in the usage sections, which is exactly where a reader arriving for a tutorial will not see them.

The performance lesson is search depth, and the readme counts the visits

One worked example in the readme is about speed, and it is the most practically useful thing in the file.

It draws a control tree, then asks how to type into a particular edit box deep in it. The naive answer is a single lookup from the root with a search depth of three, and the readme says that code runs slowly because there are more than two hundred controls before the target in the tree.

The better answer is three chained lookups.

python
window2 = uiautomation.WindowControl(searchDepth=1, Name='window2') # search 2 times
sub = window2.Control(searchDepth=1, Name='2-4')    # search 4 times
edit = sub.EditControl(searchDepth=1, Name='myedit2')   # search 2 times

Each line has a comment counting how many controls it visits, and the comments are the point: two, then four, then two, against two hundred.

The readme then notes you can collapse the three into one line, which is the same traversal with less code and identical cost, because the depth is what determines the work rather than the number of lines.

So the actual guidance is one parameter. Anyone automating a real application should read that parameter before writing anything else, because the default is a full-tree scan and the module has no index.

Browser support arrives with a version range and a command line switch

The list of supported application frameworks is where this project is most candid about its limits.

Native and managed desktop frameworks are listed as supported. The cross-platform toolkit is listed as partly supported. Two browsers are listed as supported, with a version constraint attached to one of them: version 56 and below, or 60 and above.

That exclusion is not about the wrapper. It is about the browser's own accessibility implementation, which is where the interface's data comes from. A gap in one specific range of one browser's releases is a fact about that browser, and the readme passes it through rather than hiding it.

Applications built on a desktop framework with browser engines are listed separately and carry a requirement: the application must be launched with a command line switch that forces accessibility on.

That is a harder constraint than the version range, because it means the target process has to be started a particular way, by you, on the command line, before any code of yours runs. An automation that launches its own target cannot assume the target is already running correctly.

Two caveats in one paragraph, both of them about somebody else's software, both of them stated in the same breath as the feature they limit.

The package description is one sentence and the readme is two hundred lines

Compare the two documents this project ships and one of them is three words long.

The readme is a working document: installation, version history, platform support with caveats, a worked performance example, a control tree diagram, sample output, and a reference to the platform's own pattern table.

The package's long description, which is what appears on the package index, is a single sentence naming the supported interpreter range and two processor architectures.

Everything the readme says about the two broken patch releases, the administrator requirement, the foreground requirement for packaged applications, and the browser caveats is therefore absent from the page a user reaches by searching for the package.

The manifest also classifies nine interpreter versions, from the oldest supported to a recent one, and stops there. An interpreter released after that point is unclassified rather than unsupported, which matters for the index page that renders those classifiers as the compatibility table.

So there are three statements about supported versions in this project, in three files: the readme's two specific exclusions, the manifest's classifier list, and the long description's floor. They do not contradict each other, and none of them is where a reader will look first.

Two of the repository's release scripts are batch files, and one renames the wheel

The root listing describes the project's own tooling rather than its library, and two of the entries are Windows batch files.

One of them uploads to the package index. The other generates documentation, named after the documentation generator the project uses rather than after a task.

Beside them sits a Python script whose whole job is to rename the built wheel, which is the kind of utility that exists because the project's name and its module name differ and the package index has rules about which one goes in the file name.

There is also an inspection directory, which is the module that dumps a control tree, and the console script itself sits at the root of the repository as well as in a scripts directory, because the readme tells you to run it from an installed location under the interpreter's scripts directory and the repository has to be runnable without installing.

What the listing does not have is any release automation in a portable form. Two batch files means the publish step is a Windows step, which is coherent for a Windows-only library and means a contributor on another platform cannot cut a release.

Editorial conclusion

Use uiautomation if you are automating desktop Windows applications from Python and want one dependency that talks to the platform's own accessibility interface rather than to screen coordinates or window handles. The readme is unusually good at the two things that matter here: it tells you the framework support is partial where it is partial, and it explains the one performance decision that changes how you write the code, which is to search shallow and walk down from a control you already have. Three things to know before you build on it. That the module needs elevated privileges to enumerate controls on modern Windows, which changes what your automation is allowed to touch. That two exact interpreter patch releases are documented as broken, which tells you how little the dependency's own version range means. And that the project is one person's spare-time work with no releases published, so the version you get is whatever the last upload was.

Frequently asked questions

What is the uiautomation module?

It is a Python wrapper for Microsoft's Windows UI Automation interface, Apache 2.0 licensed and written by one developer in his spare time for personal use. It targets desktop applications from Windows XP with Service Pack 3 through Windows 11, and supports native and managed desktop frameworks, the modern application shell, one cross-platform toolkit partly, and two browsers. The earlier 1.x series supported both major versions of Python with no third-party dependencies; 2.0 onward requires the third version and a type-binding dependency.

Which Python versions does uiautomation work on?

The packaging manifest classifies nine interpreter versions, from an older 3.x release up to 3.12. The readme names two exact patch releases that must be avoided because the type-binding dependency fails in them, and tells you to install an earlier or the latest version instead. Below the version where typing entered the standard library, the packaging adds the backport as an extra requirement.

Does uiautomation need administrator rights to work?

The readme says you should run Python as administrator, because otherwise the module may fail to enumerate controls or read their information on Windows 7 and later. It is a consequence of crossing a privilege boundary to read another process's controls. It also notes that on the two Windows versions where packaged applications run in their own shell, the target must be in the foreground to be automated.

Which applications can uiaut automate?

Applications that implement the platform's provider interface, listed as native C++ and Windows Forms applications, the managed desktop stack, the modern shell, one cross-platform toolkit partly, and two browsers. Two caveats come with that list: one browser is supported only at version 56 and below or at 60 and above, and applications built on a browser engine must be launched with a command line switch that forces accessibility on.

How do I make uiautomation control searches fast?

Narrow the search depth at each step and walk down from a control you have already found. The readme contrasts a single lookup from the root with a depth of three, which traverses more than two hundred controls, against three chained lookups of depth one that visit two, four and two controls, and notes the three can be written as one line because the depth rather than the line count determines the cost.

Does uiautomation work on macOS or Linux?

No. The packaging declares the platform as Windows only, and the readme's minimum-version lists cover desktop clients from Windows XP with Service Pack 3 and servers from Windows Server 2003, both marked desktop applications only. The readme names no alternative library and makes no comparison with the other Windows automation wrappers people use.

Official sources

  1. Issues
  2. License: Apache-2.0
  3. README
  4. yinkaisheng/Python-UIAutomation-for-Windows on GitHub
Add this badge to your README

If you maintain this project, the badge below links readers to this analysis and shows its maintenance status from the daily GitHub snapshot. Paste the markdown into your README; add ?metric=license or ?metric=stars to the image URL for a different field.

Add this badge to your README

markdown
[![Hysen Labs](https://hysenlabs.com/badge/yinkaisheng-python-uiautomation-for-windows.svg)](https://hysenlabs.com/projects/yinkaisheng-python-uiautomation-for-windows)

Star history chart for your README

markdown
[![Star history](https://hysenlabs.com/chart/yinkaisheng-python-uiautomation-for-windows.svg)](https://hysenlabs.com/projects/yinkaisheng-python-uiautomation-for-windows)

Was this useful?