The `types-zstd` library provides static type annotations for the `python-zstandard` compression library, enabling type checkers like MyPy to validate the correct usage of `zstd` in Python projects. It is part of the `typeshed` project, which regularly updates stubs to reflect changes in popular Python libraries and new Python versions. The current version is 1.5.7.3.20260408.
pip install types-zstdVerified import paths — ran on the pinned version, not inferred.
This quickstart demonstrates how to use the `zstd` library (from `python-zstandard`) with type hints. Installing `types-zstd` allows type checkers like MyPy to validate the arguments and return types of these `zstd` calls, catching potential errors before runtime. Remember to install `python-zstandard` for the runtime functionality.
Ensure you run `pip install python-zstandard` in addition to `pip install types-zstd`.
Install and configure a type checker (e.g., `pip install mypy`) and run it (e.g., `mypy your_script.py`) on your project.
Keep `types-zstd` and `python-zstandard` versions in sync, or pin specific versions that are known to be compatible. Review `python-zstandard` release notes for breaking changes and adapt your code accordingly.