Registry / type-stubs / types-passlib

types-passlib

JSON →
library1.7.7.20260211pypypi✓ verified 24d ago

types-passlib is a type stub package providing static type annotations for the 'passlib' library. It allows type checkers like Mypy and Pyright to analyze code that uses passlib. This package specifically targets passlib version 1.7.*. As of its latest release (1.7.7.20260211), the package is unmaintained, and any fixes or updates to the type stubs should be contributed directly to the `typeshed` project on GitHub. The upstream `passlib` library itself has maintenance concerns.

pip install types-passlib
INSTALL
IMPORT
SIG · TYPES-PASSLIB
T
types-passlib
type-stubspythonv1.7.7.20260211
Install
1.6s avg
Import
Disk
68MB
Pass rate
10/ 10
Env Coverage10 / 10
glibc
3.93.13
musl
3.93.13
Install & Compatibility
Where this runs
tested against v1.7.7.20260211 · pip install
no network on importno background threads
Install × environment matrix
Each cell = how many times install + import succeeded across repeated harness runs. Partial = flaky.
glibc = Debian/Ubuntu slim · musl = Alpine Linux
musl
py 3.103.910 runs
installs and imports cleanly · install 0.0s · import 0.000s · 69.6MB
glibc
py 3.103.910 runs
installs and imports cleanly · install 1.6s · import 0.000s · 19MB
68MB installed
● package 68MB
Code
Verified usage

Verified import paths — ran on the pinned version, not inferred.

CryptContext
from passlib_stubs.context import CryptContext
from passlib_stubs.context import CryptContext

This quickstart demonstrates the core functionality of the `passlib` library for which `types-passlib` provides type hints: hashing and verifying a password using `CryptContext` with the bcrypt scheme.

from passlib.context import CryptContext import os pwd_context = CryptContext(schemes=["bcrypt"], deprecated="auto") def hash_password(password: str) -> str: return pwd_context.hash(password) def verify_password(password: str, hashed_password: str) -> bool: return pwd_context.verify(password, hashed_password) # Example usage plain_password = os.environ.get('TEST_PASSWORD', 'mysecretpassword') hashed = hash_password(plain_password) print(f"Hashed password: {hashed}") is_valid = verify_password(plain_password, hashed) print(f"Password valid: {is_valid}") is_invalid = verify_password('wrongpassword', hashed) print(f"Wrong password valid: {is_invalid}")
Debug
Known issues
deprecatedThe `types-passlib` package is officially unmaintained and will not receive further updates on PyPI. All contributions and fixes for `passlib` type stubs should be directed to the `typeshed` project on GitHub.
fix
Contribute type stub improvements directly to the `typeshed` repository (github.com/python/typeshed). Monitor `typeshed` for updates rather than expecting `types-passlib` PyPI releases.
affects: >=1.7.7.20260211
gotchaThe upstream `passlib` library has known compatibility issues with `bcrypt` versions >= 4.1.0, leading to `AttributeError` during password hashing. This is due to `passlib` internally expecting an attribute that was removed in newer `bcrypt` versions.
fix
Downgrade the `bcrypt` library to a version below 4.1.0 (e.g., `bcrypt==4.0.1`) when using `passlib==1.7.*`.
affects: passlib==1.7.* with bcrypt>=4.1.0
breakingThe `passlib` library itself, for which these stubs are provided, is largely unmaintained (last release 1.7.4 in 2020) and has potential breakage in Python 3.13 due to the removal of the `crypt` module. While `passlib` has a fallback, its long-term compatibility and security posture are uncertain.
fix
For new projects or security-critical applications, consider actively maintained password hashing libraries or forks like `pwdlib` or `libpass` that address the maintenance concerns of upstream `passlib`. If continuing to use `passlib`, thoroughly test on Python 3.13+.
affects: passlib==1.7.* on Python>=3.13
Upgrade
Version history
1.7.7.20260211latest on PyPI · released Feb 10, 2026
Audit
Dependencies
passlibrequiredProvides the runtime functionality that these type stubs annotate.
Agent activity
52 hits · last 30 days
node
46
OpenAI (training)
1
Resources
types-passlib — pip install types-passlib · libregistry