types-olefile
Typing stubs for olefile
What it is and what it does
types-olefile is a type stub package that provides static type information for the olefile library, which handles OLE compound document files (used by older Microsoft Office formats, email attachments, and other binary container formats). It is part of the typeshed project and allows type checkers like mypy and pyright to understand the types and signatures of olefile's API, catching type errors during development rather than at runtime.
The package contains no executable code—only type annotations (.pyi files)—and has no runtime dependencies. It is tested against olefile 0.47.x and validated with mypy 1.20.0 and pyright 1.1.408. Installation is optional but recommended for projects that use olefile and want static type checking.
Use it for:
- Enable mypy or pyright to type-check code that calls olefile functions for parsing OLE documents.
- Catch type mismatches early in development when working with OLE file metadata or stream extraction.
- Provide IDE autocomplete and inline documentation for olefile methods in editors that support type stubs.
- Validate that code correctly handles olefile's return types and exceptions before runtime.
Worth the install?
AI-flagged interpretation of the facts on this page — verify before relying
Provides type annotations for the olefile package, enabling type checkers like mypy and pyright to validate code that reads and manipulates OLE (Object Linking and Embedding) files.
Yes, if you use olefile and want static type checking. It has no runtime cost, low install friction, and is actively maintained as part of typeshed. Install it alongside olefile in projects that enforce type safety; skip it only if you do not use a type checker or do not use olefile.
Install
types-olefile on PyPI
pip
pip install types-olefileuv
uv add types-olefilepoetry
poetry add types-olefileInstalling types-olefile
Before you install
Low install friction; a pure-Python stub package with no runtime dependencies. Actively maintained as part of typeshed, with recent updates as of 2026-05-08.
License in practice
Licensed under Apache-2.0 (permissive), allowing free use, modification, and distribution with minimal restrictions.
Quickstart
pip install types-olefile
import olefile
ole = olefile.OleFileIO('document.doc')
Requires Python 3.10 or later; olefile itself must be installed separately to use the types at runtime.
Verify before relying
- Whether this stub package is automatically discovered by type checkers or requires explicit configuration.
- Coverage completeness: what fraction of olefile's public API is annotated in this stub version.
Package facts
| License | Apache-2.0 (permissive) |
| Python support | supports the current Python release (>=3.10) |
| Install friction | low — pure-Python wheel |
| Runtime dependencies | none |
| Maintenance | actively maintained — 98 days since the last release |
| Last repo commit | |
| First released | |
| Downloads | 135,208/month — #11,448 on PyPI (30-day window, as of 2026-08-14) |
| Known vulnerabilities | none known (OSV.dev, checked 2026-08-14) |
Evidence: types_olefile-0.47.0.20260508-py3-none-any.whl
Tags
More Software Development packages
Provides backported and experimental type hints…
permissive · top 100 on PyPI
numpyNumPy provides an N-dimensional array object…
permissive · top 100 on PyPI
fastapiFastAPI is a Python web framework for building…
permissive · top 100 on PyPI
annotated-docProvides a way to document function parameters,…
permissive · top 100 on PyPI
typerTyper builds command-line applications from…
permissive · top 1,000 on PyPI
distlibDistlib provides low-level packaging utilities…
permissive · top 1,000 on PyPI
types-pyperclipProvides type annotations for the pyperclip…
permissive · top 15,000 on PyPI
olefileolefile parses, reads, and writes Microsoft…
permissive · top 1,000 on PyPI
types-objgraphProvides type annotations for the objgraph…
permissive · top 15,000 on PyPI
types-tabulateProvides type hints for the tabulate package,…
permissive · top 5,000 on PyPI
oletoolsoletools is a suite of Python tools to extract,…
permissive · top 5,000 on PyPI
types-MarkdownProvides type stubs for the Markdown package,…
permissive · top 5,000 on PyPI
types-jmespathProvides type annotations for the jmespath…
permissive · top 5,000 on PyPI
types-pywin32Provides type stubs for pywin32, enabling type…
permissive · top 15,000 on PyPI
types-mypy-extensionsProvides type stubs for mypy-extensions,…
permissive · top 15,000 on PyPI
compoundfilesReads and parses Microsoft Compound File Binary…
permissive · top 15,000 on PyPI