or run

npx @tessl/cli init
Log in

Version

Tile

Overview

Evals

Files

docs

index.md
tile.json

tessl/pypi-types-certifi

Type stubs for the certifi package, which provides Mozilla's curated collection of root certificates for validating SSL certificates and verifying TLS host identities in Python applications.

Workspace
tessl
Visibility
Public
Created
Last updated
Describes
pypipkg:pypi/types-certifi@2020.4.x

To install, run

npx @tessl/cli install tessl/pypi-types-certifi@2020.4.0

index.mddocs/

types-certifi

Type stubs for the certifi package, which provides Mozilla's carefully curated collection of root certificates for validating SSL certificates and verifying TLS host identities in Python applications. These type stubs enable static type checking tools like mypy to provide better type safety when working with certifi's API.

Package Information

  • Package Name: types-certifi
  • Package Type: pypi (Type stubs)
  • Language: Python
  • Installation: pip install types-certifi
  • Target Package: certifi (SSL certificate validation library)

Core Imports

import certifi

Or import the specific function:

from certifi import where

Basic Usage

import certifi

# Get the path to the CA certificate bundle
cert_path = certifi.where()
print(cert_path)  # /path/to/cacert.pem

# Use with requests or other HTTP libraries
import requests
response = requests.get('https://httpbin.org/get', verify=certifi.where())

Capabilities

Certificate Bundle Location

Returns the filesystem path to the Mozilla CA certificate bundle included with the certifi package. This function provides a reliable way to access trusted root certificates for SSL/TLS validation without depending on system certificate stores.

def where() -> str:
    """
    Return the path to the Mozilla CA certificate bundle.
    
    Returns:
        str: Absolute filesystem path to the cacert.pem bundle file
    
    Example:
        >>> import certifi
        >>> certifi.where()
        '/path/to/site-packages/certifi/cacert.pem'
    """

The certificate bundle is typically used with HTTP libraries for SSL verification:

import certifi
import requests

# Use certifi with requests
response = requests.get('https://example.com', verify=certifi.where())

# Or with urllib3
import urllib3
http = urllib3.PoolManager(cert_reqs='CERT_REQUIRED', ca_certs=certifi.where())

Architecture

The types-certifi package provides type information for the certifi library, which consists of:

  • Certificate Bundle: Mozilla's curated collection of root certificates stored as a PEM file
  • Location Function: Single where() function that returns the absolute path to the certificate bundle
  • Type Safety: Static type annotations enabling better IDE support and static analysis

The certifi package serves as a foundation for secure HTTPS communications in Python applications by providing a consistent, cross-platform source of trusted root certificates that doesn't rely on system-specific certificate stores.