{"id":18614133,"url":"https://github.com/enthought/comtypes","last_synced_at":"2026-03-03T01:01:28.451Z","repository":{"id":14297906,"uuid":"17006430","full_name":"enthought/comtypes","owner":"enthought","description":"A pure Python, lightweight COM client and server framework, based on the ctypes Python FFI package.","archived":false,"fork":false,"pushed_at":"2026-02-22T07:36:17.000Z","size":4272,"stargazers_count":336,"open_issues_count":97,"forks_count":104,"subscribers_count":55,"default_branch":"main","last_synced_at":"2026-02-28T06:54:55.684Z","etag":null,"topics":[],"latest_commit_sha":null,"homepage":"","language":"Python","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"other","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/enthought.png","metadata":{"files":{"readme":"README.md","changelog":"CHANGES.txt","contributing":"CONTRIBUTING.md","funding":".github/FUNDING.yml","license":"LICENSE.txt","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":"SECURITY.md","support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null,"zenodo":null,"notice":null,"maintainers":null,"copyright":null,"agents":null,"dco":null,"cla":null},"funding":{"tidelift":"pypi/comtypes"}},"created_at":"2014-02-20T02:05:56.000Z","updated_at":"2026-02-22T07:36:21.000Z","dependencies_parsed_at":"2023-02-19T19:45:52.131Z","dependency_job_id":"45e65c52-e89b-4cd0-85b5-df465dca7528","html_url":"https://github.com/enthought/comtypes","commit_stats":{"total_commits":759,"total_committers":33,"mean_commits":23.0,"dds":"0.32806324110671936","last_synced_commit":"d1f5cd7e6c73c52f30a36c226cdde21586cdc4b7"},"previous_names":[],"tags_count":44,"template":false,"template_full_name":null,"purl":"pkg:github/enthought/comtypes","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/enthought%2Fcomtypes","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/enthought%2Fcomtypes/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/enthought%2Fcomtypes/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/enthought%2Fcomtypes/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/enthought","download_url":"https://codeload.github.com/enthought/comtypes/tar.gz/refs/heads/main","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/enthought%2Fcomtypes/sbom","scorecard":{"id":378135,"data":{"date":"2025-08-11","repo":{"name":"github.com/enthought/comtypes","commit":"5c564eca9ec173fceafbdddd570fa5c7e1c6c564"},"scorecard":{"version":"v5.2.1-40-gf6ed084d","commit":"f6ed084d17c9236477efd66e5b258b9d4cc7b389"},"score":5,"checks":[{"name":"Security-Policy","score":10,"reason":"security policy file detected","details":["Info: security policy file detected: SECURITY.md:1","Info: Found linked content: SECURITY.md:1","Info: Found disclosure, vulnerability, and/or timelines in security policy: SECURITY.md:1","Info: Found text in security policy: SECURITY.md:1"],"documentation":{"short":"Determines if the project has published a security policy.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#security-policy"}},{"name":"Token-Permissions","score":0,"reason":"detected GitHub workflow tokens with excessive permissions","details":["Warn: no topLevel permission defined: .github/workflows/autofmt.yml:1","Warn: no topLevel permission defined: .github/workflows/autotest.yml:1","Info: no jobLevel write permissions found"],"documentation":{"short":"Determines if the project's workflows follow the principle of least privilege.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#token-permissions"}},{"name":"Maintained","score":10,"reason":"24 commit(s) and 12 issue activity found in the last 90 days -- score normalized to 10","details":null,"documentation":{"short":"Determines if the project is \"actively maintained\".","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#maintained"}},{"name":"Dangerous-Workflow","score":10,"reason":"no dangerous workflow patterns detected","details":null,"documentation":{"short":"Determines if the project's GitHub Action workflows avoid dangerous patterns.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#dangerous-workflow"}},{"name":"Binary-Artifacts","score":8,"reason":"binaries present in source code","details":["Warn: binary detected: source/Debug/AvmcIfc.dll:1","Warn: binary detected: source/Debug/AvmcIfc_x64.dll:1"],"documentation":{"short":"Determines if the project has generated executable (binary) artifacts in the source repository.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#binary-artifacts"}},{"name":"Code-Review","score":2,"reason":"Found 8/30 approved changesets -- score normalized to 2","details":null,"documentation":{"short":"Determines if the project requires human code review before pull requests (aka merge requests) are merged.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#code-review"}},{"name":"Packaging","score":-1,"reason":"packaging workflow not detected","details":["Warn: no GitHub/GitLab publishing workflow detected."],"documentation":{"short":"Determines if the project is published as a package that others can easily download, install, easily update, and uninstall.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#packaging"}},{"name":"CII-Best-Practices","score":0,"reason":"no effort to earn an OpenSSF best practices badge detected","details":null,"documentation":{"short":"Determines if the project has an OpenSSF (formerly CII) Best Practices Badge.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#cii-best-practices"}},{"name":"Pinned-Dependencies","score":0,"reason":"dependency not pinned by hash detected -- score normalized to 0","details":["Warn: GitHub-owned GitHubAction not pinned by hash: .github/workflows/autofmt.yml:11: update your workflow using https://app.stepsecurity.io/secureworkflow/enthought/comtypes/autofmt.yml/main?enable=pin","Warn: GitHub-owned GitHubAction not pinned by hash: .github/workflows/autofmt.yml:13: update your workflow using https://app.stepsecurity.io/secureworkflow/enthought/comtypes/autofmt.yml/main?enable=pin","Warn: GitHub-owned GitHubAction not pinned by hash: .github/workflows/autotest.yml:17: update your workflow using https://app.stepsecurity.io/secureworkflow/enthought/comtypes/autotest.yml/main?enable=pin","Warn: GitHub-owned GitHubAction not pinned by hash: .github/workflows/autotest.yml:19: update your workflow using https://app.stepsecurity.io/secureworkflow/enthought/comtypes/autotest.yml/main?enable=pin","Warn: third-party GitHubAction not pinned by hash: .github/workflows/autotest.yml:24: update your workflow using https://app.stepsecurity.io/secureworkflow/enthought/comtypes/autotest.yml/main?enable=pin","Warn: third-party GitHubAction not pinned by hash: .github/workflows/autotest.yml:39: update your workflow using https://app.stepsecurity.io/secureworkflow/enthought/comtypes/autotest.yml/main?enable=pin","Warn: GitHub-owned GitHubAction not pinned by hash: .github/workflows/autotest.yml:57: update your workflow using https://app.stepsecurity.io/secureworkflow/enthought/comtypes/autotest.yml/main?enable=pin","Warn: GitHub-owned GitHubAction not pinned by hash: .github/workflows/autotest.yml:59: update your workflow using https://app.stepsecurity.io/secureworkflow/enthought/comtypes/autotest.yml/main?enable=pin","Warn: GitHub-owned GitHubAction not pinned by hash: .github/workflows/autotest.yml:73: update your workflow using https://app.stepsecurity.io/secureworkflow/enthought/comtypes/autotest.yml/main?enable=pin","Warn: GitHub-owned GitHubAction not pinned by hash: .github/workflows/autotest.yml:75: update your workflow using https://app.stepsecurity.io/secureworkflow/enthought/comtypes/autotest.yml/main?enable=pin","Warn: third-party GitHubAction not pinned by hash: .github/workflows/autotest.yml:84: update your workflow using https://app.stepsecurity.io/secureworkflow/enthought/comtypes/autotest.yml/main?enable=pin","Info:   0 out of   8 GitHub-owned GitHubAction dependencies pinned","Info:   0 out of   3 third-party GitHubAction dependencies pinned"],"documentation":{"short":"Determines if the project has declared and pinned the dependencies of its build process.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#pinned-dependencies"}},{"name":"License","score":9,"reason":"license file detected","details":["Info: project has a license file: LICENSE.txt:0","Warn: project license file does not contain an FSF or OSI license."],"documentation":{"short":"Determines if the project has defined a license.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#license"}},{"name":"Fuzzing","score":0,"reason":"project is not fuzzed","details":["Warn: no fuzzer integrations found"],"documentation":{"short":"Determines if the project uses fuzzing.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#fuzzing"}},{"name":"Vulnerabilities","score":10,"reason":"0 existing vulnerabilities detected","details":null,"documentation":{"short":"Determines if the project has open, known unfixed vulnerabilities.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#vulnerabilities"}},{"name":"Signed-Releases","score":0,"reason":"Project has not signed or included provenance with any releases.","details":["Warn: release artifact 1.4.11 not signed: https://api.github.com/repos/enthought/comtypes/releases/218692205","Warn: release artifact 1.4.10 not signed: https://api.github.com/repos/enthought/comtypes/releases/199271864","Warn: release artifact 1.4.9 not signed: https://api.github.com/repos/enthought/comtypes/releases/193395279","Warn: release artifact 1.4.8 not signed: https://api.github.com/repos/enthought/comtypes/releases/180904927","Warn: release artifact 1.4.7 not signed: https://api.github.com/repos/enthought/comtypes/releases/174095716","Warn: release artifact 1.4.11 does not have provenance: https://api.github.com/repos/enthought/comtypes/releases/218692205","Warn: release artifact 1.4.10 does not have provenance: https://api.github.com/repos/enthought/comtypes/releases/199271864","Warn: release artifact 1.4.9 does not have provenance: https://api.github.com/repos/enthought/comtypes/releases/193395279","Warn: release artifact 1.4.8 does not have provenance: https://api.github.com/repos/enthought/comtypes/releases/180904927","Warn: release artifact 1.4.7 does not have provenance: https://api.github.com/repos/enthought/comtypes/releases/174095716"],"documentation":{"short":"Determines if the project cryptographically signs release artifacts.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#signed-releases"}},{"name":"Branch-Protection","score":-1,"reason":"internal error: error during branchesHandler.setup: internal error: githubv4.Query: Resource not accessible by integration","details":null,"documentation":{"short":"Determines if the default and release branches are protected with GitHub's branch protection settings.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#branch-protection"}},{"name":"SAST","score":0,"reason":"SAST tool is not run on all commits -- score normalized to 0","details":["Warn: 0 commits out of 30 are checked with a SAST tool"],"documentation":{"short":"Determines if the project uses static code analysis.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#sast"}}]},"last_synced_at":"2025-08-18T14:44:44.293Z","repository_id":14297906,"created_at":"2025-08-18T14:44:44.294Z","updated_at":"2025-08-18T14:44:44.294Z"},"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":286080680,"owners_count":30028228,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2026-03-03T00:31:48.536Z","status":"ssl_error","status_checked_at":"2026-03-03T00:30:56.176Z","response_time":60,"last_error":"SSL_read: unexpected eof while reading","robots_txt_status":"success","robots_txt_updated_at":"2025-07-24T06:49:26.215Z","robots_txt_url":"https://github.com/robots.txt","online":false,"can_crawl_api":true,"host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":[],"created_at":"2024-11-07T03:25:16.864Z","updated_at":"2026-03-03T01:01:28.432Z","avatar_url":"https://github.com/enthought.png","language":"Python","funding_links":["https://tidelift.com/funding/github/pypi/comtypes","https://tidelift.com/badges/package/pypi/comtypes","https://tidelift.com/subscription/pkg/pypi-comtypes?utm_source=pypi-comtypes\u0026utm_medium=readme","https://tidelift.com/subscription/pkg/pypi-comtypes?utm_source=pypi-comtypes\u0026utm_medium=referral\u0026utm_campaign=github"],"categories":[],"sub_categories":[],"readme":"# comtypes\n\n![Works on Windows only](https://img.shields.io/badge/-Windows-0078D6.svg?logo=windows\u0026style=flat)  \n[![PyPI version](https://badge.fury.io/py/comtypes.svg)](https://pypi.org/project/comtypes/) [![PyPI - Python Version](https://img.shields.io/pypi/pyversions/comtypes)](https://pypi.org/project/comtypes/) [![PyPI - Python Requires](https://img.shields.io/badge/dynamic/json?url=https%3A%2F%2Fpypi.org%2Fpypi%2Fcomtypes%2Fjson\u0026query=info.requires_python\u0026label=Python\u0026nbsp;Requires)](https://pypi.org/project/comtypes/)  \n[![PyPI - License](https://img.shields.io/pypi/l/comtypes)](https://pypi.org/project/comtypes/) [![PyPI - Downloads](https://img.shields.io/pypi/dm/comtypes)](https://pypi.org/project/comtypes/)  \n[![GitHub Repo stars](https://img.shields.io/github/stars/enthought/comtypes?style=social)](https://github.com/enthought/comtypes/stargazers) [![GitHub forks](https://img.shields.io/github/forks/enthought/comtypes?style=social)](https://github.com/enthought/comtypes/network/members) [![Ruff](https://img.shields.io/endpoint?url=https://raw.githubusercontent.com/astral-sh/ruff/main/assets/badge/v2.json)](https://github.com/astral-sh/ruff)  \n[![Tidelift Subscription](https://tidelift.com/badges/package/pypi/comtypes)](https://tidelift.com/subscription/pkg/pypi-comtypes?utm_source=pypi-comtypes\u0026utm_medium=readme) [![Coverage](https://img.shields.io/codecov/c/github/enthought/comtypes)](https://app.codecov.io/github/enthought/comtypes)  \n\n\n`comtypes` is a lightweight pure Python [COM](https://learn.microsoft.com/en-us/windows/win32/com/component-object-model--com--portal) package based on the [`ctypes`](https://docs.python.org/library/ctypes.html) foreign function interface library.\n\n`comtypes` allows you to define, call, and implement custom and dispatch-based COM interfaces in pure Python.\n\n`comtypes` requires Windows and Python 3.9 or later.\n\n- **Note about Python 3.15 and `enum` behavior**  \n  Starting with Python 3.15, the internal handling of `IntFlag`(`Flag`) values is planned to change:  \n  **Negative `IntFlag` members will be reinterpreted by masking them to the defined positive bit domain, instead of keeping their original negative literal values**.  \n  This can affect enumeration types generated by `comtypes` from COM type libraries. Action is needed to maintain literal evaluation.  \n  For details and ongoing discussion, see: [GH-894](https://github.com/enthought/comtypes/issues/894).\n- Version [1.4.12](https://pypi.org/project/comtypes/1.4.12/) is the last version to support Python 3.8.\n- Version \u003c= [1.4.7](https://pypi.org/project/comtypes/1.4.7/) does not work with Python 3.13 as reported in [GH-618](https://github.com/enthought/comtypes/issues/618). Version [1.4.8](https://pypi.org/project/comtypes/1.4.8/) can work with Python 3.13.\n- Version [1.4.6](https://pypi.org/project/comtypes/1.4.6/) is the last version to support Python 3.7.\n- Version [1.2.1](https://pypi.org/project/comtypes/1.2.1/) is the last version to support Python 2.7 and 3.3–3.6.\n- Certain `comtypes` functions may not work correctly in Python 3.8 and 3.9 as reported in [GH-212](https://github.com/enthought/comtypes/issues/212). This bug has been fixed in Python \u003e= 3.10.10 and \u003e= 3.11.2.\n\n## Installation\n\n`comtypes` is available on [PyPI](https://pypi.org/project/comtypes) and can be installed with `pip`:\n```sh\n# PyPI\npip install comtypes\n```\n\nThe source code is currently hosted [here](https://github.com/enthought/comtypes) on GitHub.\n\n### Dependencies\n\n`comtypes` is a pure Python package — it has no additional required dependencies.\n\nOptional functionalities can be enabled by installing:\n- `numpy`, in order to process arrays as `numpy`'s `ndarray`.\n- `mypy` or other static type checkers, in order to interpret type hints.\n\nNone of these packages, however, are required in order to run `comtypes`.\n\n## Community\n\nThe [GitHub repository](https://github.com/enthought/comtypes) is used for tracking issues, reporting bugs, and contributing to the codebase and documentation.\n\n## For Enterprise\n\nAvailable as part of the Tidelift Subscription.\n\nThis 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.\n\n[Learn more](https://tidelift.com/subscription/pkg/pypi-comtypes?utm_source=pypi-comtypes\u0026utm_medium=referral\u0026utm_campaign=github).\n\n## Frequently Asked Questions\n\n### Q: Why does this package not support platforms other than Windows?\n**A:** The [Microsoft Component Object Model (COM)](https://learn.microsoft.com/en-us/windows/win32/com/com-technical-overview) is a technology that is unique to Windows and is not supported on other platforms.\n\n[The phrase _\"COM is a platform-independent\"_ in the MS documentation](https://learn.microsoft.com/en-us/windows/win32/com/component-object-model--com--portal) means that COM maintains compatibility across different versions of Windows, and does NOT imply that it is supported on Linux or Mac.\n\nFor as long as COM is not supported outside of Windows, there is no plan to port `comtypes` to other platforms.\n\n### Q: Why does `cannot import name 'COMError' from '_ctypes'` error occur when using this package on platforms other than Windows?\n**A:** The [`_ctypes`](https://github.com/python/cpython/blob/main/Modules/_ctypes/_ctypes.c) is part of the internal implementation of the [`ctypes`](https://github.com/python/cpython/blob/main/Lib/ctypes/) standard library that exists for Python on all platforms.\nHowever, `COMError` and COM-related features are only implemented in Python for Windows.\n\nIn cross-platform software development, care must be taken to ensure that codebases that depend on `comtypes` do not execute in environments other than Windows.\n\n### 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.\n\n**A:** Executing `py -m comtypes.clear_cache` and then running the script again might resolve the problem.\n\nWhen `comtypes.client.GetModule` is called (either directly or indirectly), `comtypes` generates Python module files.  \nIf Python is forced to terminate or crashes in the middle of file generation, the codebase written to the file becomes partial.  \nWhen Python tries to import this unexecutable partial codebase module, an error occurs.\n\nExecuting `py -m comtypes.clear_cache` identifies the directories where the \"cache module files\" are stored and deletes them.  \nAfter deleting these partial modules and running the script again, `comtypes.client.GetModule` is called and executable modules are generated anew.\n\nHowever, if the script implementation does not use `comtypes.client.GetModule` or processes generated files, it may not be a solution.\n\n## Documentation\n\nThe documentation is currently hosted [here](https://comtypes.readthedocs.io/) on ReadTheDocs.\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fenthought%2Fcomtypes","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fenthought%2Fcomtypes","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fenthought%2Fcomtypes/lists"}