This package provides typing stubs for the `python-slugify` library, enabling static type checkers like MyPy or Pyright to validate usage of `python-slugify`. It does not contain any executable code itself. The current version is 8.0.2.20240310. As part of the typeshed project, its releases are typically tied to updates in the upstream `python-slugify` library or typeshed's own update cadence.
pip install types-python-slugifyVerified import paths — ran on the pinned version, not inferred.
This quickstart demonstrates how to use `python-slugify` with type checking enabled by `types-python-slugify`. It shows basic slug generation and creating a custom `Slugify` instance. To use these stubs, both `python-slugify` and `types-python-slugify` must be installed. A type checker like MyPy will then automatically leverage these stubs for static analysis.
Ensure you install `python-slugify` in addition to `types-python-slugify` (e.g., `pip install python-slugify types-python-slugify`) and import symbols directly from `slugify`.
Always use `from slugify import slugify` or `from slugify import Slugify` for importing the functionality. The stub package is automatically picked up by type checkers.
While generally compatible, be aware that exact version alignment between the runtime library and its stubs is not guaranteed for every patch release. For critical applications, verify compatibility with your specific `python-slugify` version.