comtypes
Pure Python COM package
Decision gist · record as of 2026-08-14
Yes, if you are on Windows and need to interact with COM interfaces or automate Windows applications. The package is production-stable, actively maintained, has no external dependencies, and carries no known vulnerabilities. The main constraint is that it is Windows-only and requires Python 3.9+; if you are cross-platform or on an older Python version, it will not work for you.AI-flagged interpretation of the facts on this page — verify before relying
Before you install
- Windows operating system required; COM is a Windows-specific technology.
- Python 3.9 or later is required.
- Installation is straightforward with no runtime dependencies.
License · maintenance · safety
MIT (permissive) — Licensed under MIT (permissive), so you can use, modify, and distribute comtypes freely in commercial and open-source projects with minimal restrictions.
last release 2026-03-02 (165 days) · last repo commit 2026-06-16 · 343 stars
0 known vulnerabilities (OSV.dev, 2026-08-14) · 5,779,459 downloads/mo, #2,039 on PyPI
Alternatives
Verify before relying
pip install comtypes
import comtypes
from comtypes.client import GetObject
# Example: interact with a COM object
obj = GetObject(None, 'ProgID.ClassName')- Whether the Python 3.15 IntFlag behavior change (GH-894) will require code updates for existing projects using comtypes.
- Performance characteristics when working with large COM arrays or complex type hierarchies.
- Compatibility status with the latest Windows versions and COM implementations.
What it is and what it does
comtypes is a pure Python wrapper around the Windows Component Object Model (COM), built on top of ctypes. It lets you call COM interfaces from Python code, define custom COM interfaces, and work with dispatch-based COM objects without requiring compiled extensions or external dependencies. The library generates Python modules from COM type libraries, allowing you to interact with Windows applications and system components that expose COM interfaces.
The package is designed for developers who need to automate Windows applications, access system COM services, or integrate Python with legacy Windows software. It has no required runtime dependencies beyond Python itself, though numpy can optionally be installed to handle COM arrays as numpy ndarrays. The library is actively maintained and widely used in the top 5000 PyPI packages by download volume.
Use it for
- Automate Microsoft Office applications (Word, Excel, Outlook) from Python scripts.
- Access Windows system COM services and APIs for system administration or monitoring tasks.
- Build Python wrappers around proprietary Windows applications that expose COM interfaces.
- Integrate Python with legacy Windows software that communicates via COM.
- Generate type-safe Python bindings from COM type libraries for interoperability.
Worth the install?
AI-flagged interpretation of the facts on this page. Verify before relying on it.
Yes, if you are on Windows and need to interact with COM interfaces or automate Windows applications.
The package is production-stable, actively maintained, has no external dependencies, and carries no known vulnerabilities. The main constraint is that it is Windows-only and requires Python 3.9+; if you are cross-platform or on an older Python version, it will not work for you.
Install
comtypes on PyPI
Before you install
Installation is straightforward with no runtime dependencies. The package is actively maintained with recent commits and has been in production use since 2014. However, it is Windows-only and requires Python 3.9 or later; users on Python 3.8 or earlier will need an older version.
Windows operating system required; COM is a Windows-specific technology. Python 3.9 or later is required.
License in practice
Licensed under MIT (permissive), so you can use, modify, and distribute comtypes freely in commercial and open-source projects with minimal restrictions.
Quickstart
pip install comtypes
import comtypes
from comtypes.client import GetObject
# Example: interact with a COM object
obj = GetObject(None, 'ProgID.ClassName')
Verify before relying
- Whether the Python 3.15 IntFlag behavior change (GH-894) will require code updates for existing projects using comtypes.
- Performance characteristics when working with large COM arrays or complex type hierarchies.
- Compatibility status with the latest Windows versions and COM implementations.
Package facts
| License | MIT permissive |
| Python support | Supports the current Python release >=3.9 |
| Install friction | Low. Pure-Python wheel |
| Runtime dependencies | None |
| Maintenance | Actively maintained 165 days since the last release |
| Last repo commit | |
| First released | |
| Downloads | 5,779,459 / month, #2,039 on PyPI 30-day window, as of 2026-08-14 |
| Known vulnerabilities | None known OSV.dev, checked 2026-08-14 |
| Classifiers | Development Status :: 5 - Production/StableIntended Audience :: DevelopersOperating System :: Microsoft :: WindowsProgramming Language :: PythonProgramming Language :: Python :: 3Topic :: Software Development :: Libraries :: Python Modules |
Evidence: comtypes-1.4.16-py3-none-any.whl
Tags
Let your AI agent find packages like this
Example. Real query, live index.
You found this page by searching. An agent finds it by wishing: SkillFed indexes 14,416 PyPI packages by what they can do, searchable in plain language.
wish › “COM interface python windows”
- comtypescomtypes is a pure Python library for defining, calling, and…
- WMIWMI wraps Windows Management Instrumentation to let Python code query…
- pywin32Provides Python access to Windows APIs and COM interfaces for…
Give your agent the search over MCP, or paste the wish link into any chat.
More Python Modules packages
Converts domain names between Unicode and ASCII-compatible encoding (Punycode) according to IDNA 2008 and Unicode Technical Standard 46, with security validation and broader script coverage than the standard library.
Install it if you work with internationalized domain names, need to validate domains, or use HTTP clients that depend on it transitively.
Setuptools is a Python build backend and package management tool that handles building, distributing, and installing Python packages, including support for C/C++ extension modules.
PyYAML parses and emits YAML 1.1 data format, enabling serialization and deserialization of configuration files and Python objects to and from human-readable YAML text.
Pydantic validates Python data structures against type hints, coercing and checking input at runtime to ensure it matches a declared schema.
Provides reusable metadata objects for use with PEP-593 `typing.Annotated` to express common constraints like bounds, collection sizes, and predicates on types.
Install it if you use or build libraries that need to express type constraints in a standardized, inspectable way—or if you want to annotate your own types with…
Provides runtime tools to inspect and introspect Python type annotations, enabling programmatic examination of type hints at execution time.
See also pywin32-ctypes · pyseccomp · ctypesgen · pgi · pypyodbc · pywin32 · jaraco.windows · pyclibrary · pywinauto · cffi