comtypes
A pure Python, lightweight COM client and server framework, based on the ctypes Python FFI package.
Science Score: 36.0%
This score indicates how likely this project is to be science-related based on various indicators:
-
○CITATION.cff file
-
✓codemeta.json file
Found codemeta.json file -
✓.zenodo.json file
Found .zenodo.json file -
○DOI references
-
○Academic publication links
-
✓Committers with academic emails
1 of 42 committers (2.4%) from academic institutions -
○Institutional organization owner
-
○JOSS paper metadata
-
○Scientific vocabulary similarity
Low similarity (11.4%) to scientific vocabulary
Keywords from Contributors
Repository
A pure Python, lightweight COM client and server framework, based on the ctypes Python FFI package.
Basic Info
Statistics
- Stars: 324
- Watchers: 55
- Forks: 103
- Open Issues: 97
- Releases: 31
Metadata Files
README.md
comtypes
comtypes is a lightweight pure Python COM package based on the ctypes foreign function interface library.
comtypes allows you to define, call, and implement custom and dispatch-based COM interfaces in pure Python.
comtypes requires Windows and Python 3.8 or later.
- Version <= 1.4.7 does not work with Python 3.13 as reported in GH-618. Version 1.4.8 can work with Python 3.13.
- Version 1.4.6 is the last version to support Python 3.7.
- Version 1.2.1 is the last version to support Python 2.7 and 3.3–3.6.
- comtypes does not work with Python 3.8.1 as reported in GH-202. This bug has been fixed in Python >= 3.8.2.
- Certain comtypes functions may not work correctly in Python 3.8 and 3.9 as reported in GH-212. This bug has been fixed in Python >= 3.10.10 and >= 3.11.2.
Installation
comtypes is available on PyPI and can be installed with pip:
```sh
PyPI
pip install comtypes ```
The source code is currently hosted here on GitHub.
Dependencies
comtypes is a pure Python package — it has no additional required dependencies.
Optional functionalities can be enabled by installing:
- numpy, in order to process arrays as numpy's ndarray.
- mypy or other static type checkers, in order to interpret type hints.
None of these packages, however, are required in order to run comtypes.
Community
The GitHub repository is used for tracking issues, reporting bugs, and contributing to the codebase and documentation.
For Enterprise
Available as part of the Tidelift Subscription.
This project and the maintainers of thousands of other packages are working with Tidelift to deliver one enterprise subscription that covers all of the open source you use.
Frequently Asked Questions
Q: Why does this package not support platforms other than Windows?
A: The Microsoft Component Object Model (COM) is a technology that is unique to Windows and is not supported on other platforms.
The phrase "COM is a platform-independent" in the MS documentation means that COM maintains compatibility across different versions of Windows, and does NOT imply that it is supported on Linux or Mac.
For as long as COM is not supported outside of Windows, there is no plan to port comtypes to other platforms.
Q: Why does cannot import name 'COMError' from '_ctypes' error occur when using this package on platforms other than Windows?
A: The _ctypes is part of the internal implementation of the ctypes standard library that exists for Python on all platforms.
However, COMError and COM-related features are only implemented in Python for Windows.
In cross-platform software development, care must be taken to ensure that codebases that depend on comtypes do not execute in environments other than Windows.
Q: Despite a script that depends on comtypes having run successfully before, a error (ImportError, NameError, or SyntaxError) is raised now, and the same error occurs again and again.
A: Executing py -m comtypes.clear_cache and then running the script again might resolve the problem.
When comtypes.client.GetModule is called (either directly or indirectly), comtypes generates Python module files.
If Python is forced to terminate or crashes in the middle of file generation, the codebase written to the file becomes partial.
When Python tries to import this unexecutable partial codebase module, an error occurs.
Executing py -m comtypes.clear_cache identifies the directories where the "cache module files" are stored and deletes them.
After deleting these partial modules and running the script again, comtypes.client.GetModule is called and executable modules are generated anew.
However, if the script implementation does not use comtypes.client.GetModule or processes generated files, it may not be a solution.
Documentation
The documentation is currently hosted here on ReadTheDocs.
Owner
- Name: Enthought, Inc.
- Login: enthought
- Kind: organization
- Location: Austin, TX
- Website: http://www.enthought.com/
- Repositories: 149
- Profile: https://github.com/enthought
GitHub Events
Total
- Create event: 6
- Release event: 5
- Issues event: 65
- Watch event: 33
- Delete event: 1
- Issue comment event: 191
- Push event: 174
- Pull request review comment event: 44
- Pull request event: 358
- Pull request review event: 92
- Fork event: 9
Last Year
- Create event: 6
- Release event: 5
- Issues event: 65
- Watch event: 33
- Delete event: 1
- Issue comment event: 191
- Push event: 174
- Pull request review comment event: 44
- Pull request event: 358
- Pull request review event: 92
- Fork event: 9
Committers
Last synced: 10 months ago
Top Committers
| Name | Commits | |
|---|---|---|
| thomas.heller | n****e@n****e | 510 |
| Jun Komoda | 4****d | 280 |
| Christopher L. Farrow | c****w@e****m | 66 |
| Jason R. Coombs | j****o@j****m | 48 |
| Vasily Ryabov | v****v@g****m | 35 |
| moi15moi | 8****i | 28 |
| newwingbird | 6****d | 10 |
| Kevin Schlosser | k****r | 6 |
| laripk | l****y@f****m | 5 |
| Thomas Geppert | g****i | 4 |
| Joshua Klein | m****n@g****m | 3 |
| Ben Rowland | b****d@m****m | 3 |
| Leonard de Ruijter | l****d@b****m | 3 |
| Fredrik Orderud | f****d@g****m | 3 |
| Dustin Wyatt | d****t@g****m | 2 |
| Fredrik Orderud | f****d | 2 |
| Merajul Arefin | m****n@g****m | 2 |
| fusentasticus | f****s | 2 |
| mark.dickinson | m****n@e****m | 2 |
| orf | t****m@t****s | 2 |
| Jan Klusacek | j****k@t****m | 1 |
| matt wilkie | m****w@g****m | 1 |
| kyleMR | k****e@g****m | 1 |
| jonschz | 1****z | 1 |
| fmtabler | 9****r | 1 |
| davidschranz | d****z@g****m | 1 |
| Yuan-Hao Chen | y****6@g****m | 1 |
| William Schwartz | w****z@g****m | 1 |
| Umar Butler | u****r@u****u | 1 |
| Thomas Kellermeier | t****r@h****e | 1 |
| and 12 more... | ||
Committer Domains (Top 20 + Academic)
Issues and Pull Requests
Last synced: 6 months ago
All Time
- Total issues: 145
- Total pull requests: 481
- Average time to close issues: over 1 year
- Average time to close pull requests: 10 days
- Total issue authors: 68
- Total pull request authors: 18
- Average comments per issue: 5.21
- Average comments per pull request: 0.91
- Merged pull requests: 437
- Bot issues: 0
- Bot pull requests: 0
Past Year
- Issues: 37
- Pull requests: 321
- Average time to close issues: 27 days
- Average time to close pull requests: about 23 hours
- Issue authors: 10
- Pull request authors: 7
- Average comments per issue: 1.95
- Average comments per pull request: 0.42
- Merged pull requests: 294
- Bot issues: 0
- Bot pull requests: 0
Top Authors
Issue Authors
- junkmd (61)
- moi15moi (6)
- bennyrowland (5)
- jonschz (3)
- jaraco (3)
- cfarrow (2)
- nanonyme (2)
- theobinomy (2)
- DManowitz (2)
- parsasaei (2)
- sindzicat (2)
- LeonarddeR (2)
- BasilcM (1)
- monkeycc (1)
- deusyss (1)
Pull Request Authors
- junkmd (506)
- moi15moi (72)
- newwingbird (20)
- geppi (8)
- jonschz (7)
- forderud (6)
- kdschlosser (5)
- jaraco (4)
- CristiFati (3)
- vasily-v-ryabov (2)
- bennyrowland (2)
- v01d-gh (2)
- umarbutler (2)
- fmtabler (2)
- cosmastech (2)
Top Labels
Issue Labels
Pull Request Labels
Packages
- Total packages: 4
-
Total downloads:
- pypi 2,869,862 last-month
- Total docker downloads: 126
-
Total dependent packages: 115
(may contain duplicates) -
Total dependent repositories: 4,251
(may contain duplicates) - Total versions: 66
- Total maintainers: 7
pypi.org: comtypes
Pure Python COM package
- Homepage: https://github.com/enthought/comtypes
- Documentation: https://comtypes.readthedocs.io/
- License: MIT License
-
Latest release: 1.4.12
published 6 months ago
Rankings
Maintainers (6)
pypi.org: comtypes-fork
Pure Python COM package
- Homepage: https://github.com/enthought/comtypes
- Documentation: https://comtypes-fork.readthedocs.io/
- License: MIT License
-
Latest release: 1.1.10
published about 4 years ago
Rankings
Maintainers (1)
conda-forge.org: comtypes
comtypes is a pure Python COM package based on the ctypes ffi foreign function library.The comtypes package makes it easy to access and implement both custom and dispatch based COM interfaces.While the pywin32 package contains superior client side support for dispatch based COM interfaces,it is not possible to access custom COM interfaces unless they are wrapped in C++-code.
- Homepage: http://starship.python.net/crew/theller/comtypes/
- License: MIT
-
Latest release: 1.1.14
published over 3 years ago
Rankings
anaconda.org: comtypes
comtypes is a pure Python COM package based on the ctypes ffi foreign function library.The comtypes package makes it easy to access and implement both custom and dispatch based COM interfaces.While the pywin32 package contains superior client side support for dispatch based COM interfaces,it is not possible to access custom COM interfaces unless they are wrapped in C++-code.
- Homepage: https://github.com/enthought/comtypes/
- License: MIT
-
Latest release: 1.4.11
published 8 months ago