{"id":22496,"library":"types-olefile","title":"Types for olefile","description":"Typing stubs for olefile (v0.47.0.20260408), provided by typeshed. These stubs enable static type checking for the olefile package. The package follows typeshed's release cadence, typically updated to match CPython's typing stubs.","status":"active","version":"0.47.0.20260408","language":"python","source_language":"en","source_url":"https://github.com/python/typeshed/tree/main/stubs/olefile","tags":["typeshed","typing-stubs","olefile","OLE2","type-hints"],"install":[{"cmd":"pip install types-olefile","lang":"bash","label":"Install from PyPI"}],"dependencies":[{"reason":"Runtime dependency for which types are provided","package":"olefile","optional":false}],"imports":[{"note":"Correct import from olefile, types are provided by types-olefile.","wrong":null,"symbol":"OleFileIO","correct":"from olefile import OleFileIO"},{"note":"types-olefile provides stubs for olefile, it does not export any symbols directly.","wrong":"from types_olefile import OleFileIO","symbol":"OleFileIO","correct":"from olefile import OleFileIO"}],"quickstart":{"code":"from olefile import OleFileIO\n\nwith OleFileIO('example.ole') as ole:\n    if ole.exists('\\x05SummaryInformation'):\n        meta = ole.get_metadata()\n        print(meta.author, meta.title)","lang":"python","description":"Open an OLE2 file, check for stream existence, and read metadata."},"warnings":[{"fix":"Install both: pip install olefile types-olefile","message":"You must install both olefile and types-olefile. types-olefile alone does not provide runtime functionality.","severity":"gotcha","affected_versions":"all"},{"fix":"Use only documented public API to benefit from type hints.","message":"The stubs only cover olefile's public API. Internal functions or undocumented methods may not be typed.","severity":"gotcha","affected_versions":"all"},{"fix":"Use OleFileIO.get_metadata() instead.","message":"Some older olefile methods like `getproperties` are deprecated and not fully typed in stubs.","severity":"deprecated","affected_versions":">=0.47.0.20260408"}],"env_vars":null,"last_verified":"2026-04-27T00:00:00.000Z","next_check":"2026-07-26T00:00:00.000Z","problems":[{"fix":"pip install olefile","cause":"Missing olefile runtime package.","error":"ModuleNotFoundError: No module named 'olefile'"},{"fix":"Use 'from olefile import OleFileIO'","cause":"Importing from types_olefile instead of olefile.","error":"Cannot find reference 'OleFileIO' in 'types_olefile'"}],"ecosystem":"pypi","meta_description":null,"install_score":null,"install_tag":null,"quickstart_score":null,"quickstart_tag":null}