# How the StreamInfo Class Works in MarkItDown: Immutable Metadata Handling

> Learn how MarkItDown's StreamInfo class handles immutable metadata. Discover its copy and update method for safe stream info tracking and updates without side effects.

- Repository: [Microsoft/markitdown](https://github.com/microsoft/markitdown)
- Tags: internals
- Published: 2026-04-11

---

**The `StreamInfo` class is an immutable dataclass in MarkItDown that encapsulates file metadata—such as MIME type, extension, and source URL—allowing converters to track and update stream information without side effects through its `copy_and_update` method.**

The `StreamInfo` class serves as the central metadata container throughout the microsoft/markitdown codebase. Defined in [`packages/markitdown/src/markitdown/_stream_info.py`](https://github.com/microsoft/markitdown/blob/main/packages/markitdown/src/markitdown/_stream_info.py), this lightweight data structure travels with file-like streams as they pass through various converters, ensuring that critical file attributes remain available