types-certifi is a PEP 561 type stub package providing external type annotations for the `certifi` library, which itself provides Mozilla's carefully curated collection of Root Certificates for validating SSL certificates in Python applications. It is used by static type-checking tools like Mypy and Pyright to analyze code that uses `certifi`. This specific package version (2021.10.8.3) is an older snapshot from the `typeshed` project.
pip install types-certifiVerified import paths — ran on the pinned version, not inferred.
This quickstart demonstrates typical usage of the `certifi` library, for which `types-certifi` provides type stubs. The `certifi.where()` function returns the path to the CA certificate bundle. When `types-certifi` is installed alongside `certifi`, a type checker can statically analyze the usage of `certifi`'s functions and ensure type correctness.
Uninstall `types-certifi`: `pip uninstall types-certifi`. Ensure your `certifi` package is up-to-date: `pip install --upgrade certifi`.
Always import symbols from the original runtime library (`certifi`), not from `types_certifi`. `types-certifi` works implicitly with your type checker.
Ensure that if you *must* use `types-certifi` (i.e., with an older `certifi` without inline types), its version aligns with the `certifi` version it's stubbing. The safest approach for modern projects is to update `certifi` and remove `types-certifi`.
Install `certifi`: `pip install certifi`.
Install `certifi`: `pip install certifi`. Make sure `certifi` is listed in your project's dependencies (e.g., `requirements.txt`).