pkce
PKCE Pyhton generator.
What it is and what it does
pkce is a lightweight Python module that generates the cryptographic components required for OAuth authorization flows using PKCE (Proof Key for Code Exchange). It provides two main functions: one to generate both a code verifier and its corresponding challenge in a single call, and another to generate a verifier of a specified length and separately compute its challenge. The module has no runtime dependencies and requires Python 3 or later.
The package implements RFC 7636, which defines PKCE as a security extension to the OAuth authorization code flow. It is typically used in mobile apps, single-page applications, and other public clients that cannot securely store a client secret. The module's simplicity makes it suitable for projects that need PKCE support without additional complexity, though its abandoned maintenance status since 2021 means no active development or bug fixes are forthcoming.
Use it for:
- Generate PKCE parameters for mobile app OAuth login flows to prevent authorization code interception attacks.
- Implement secure OAuth authentication in single-page applications without a backend to store secrets.
- Create code verifier and challenge pairs for testing OAuth PKCE compliance in authorization servers.
- Build CLI tools or scripts that interact with OAuth providers requiring PKCE authentication.
Worth the install?
AI-flagged interpretation of the facts on this page — verify before relying
Generates PKCE (Proof Key for Code Exchange) code verifiers and challenges for OAuth authorization flows, implementing RFC 7636.
Yes, if you need straightforward PKCE code generation for OAuth flows and can accept that the package is no longer actively maintained. The underlying PKCE specification is stable, and the module's narrow scope means abandonment poses minimal practical risk. For production use, verify that the implementation matches your provider's PKCE requirements and consider whether you need active maintenance or community support.
Install
pkce on PyPI
pip
pip install pkceuv
uv add pkcepoetry
poetry add pkceInstalling pkce
Before you install
Installation is straightforward with no runtime dependencies. The package is abandoned as of 2021 with no recent maintenance, though the underlying PKCE specification is stable and unlikely to change.
License in practice
MIT license permits commercial and private use with minimal restrictions—suitable for most projects.
Quickstart
pip install pkce
import pkce
code_verifier, code_challenge = pkce.generate_pkce_pair()
# Or separately:
code_verifier = pkce.generate_code_verifier(length=128)
code_challenge = pkce.get_code_challenge(code_verifier)
Verify before relying
- Whether the package correctly implements all PKCE variants as specified in RFC 7636.
- Current compatibility with modern OAuth providers and whether the abandoned status poses practical risk for new integrations.
Package facts
| License | MIT (permissive) |
| Python support | supports the current Python release (>=3) |
| Install friction | low — pure-Python wheel |
| Runtime dependencies | none |
| Maintenance | abandoned — 2,013 days since the last release |
| Last repo commit | |
| First released | |
| Downloads | 3,132,110/month — #2,738 on PyPI (30-day window, as of 2026-08-14) |
| Known vulnerabilities | none known (OSV.dev, checked 2026-08-14) |
Evidence: pkce-1.0.3-py3-none-any.whl
Tags
More Cryptography packages
Certifi provides Mozilla's curated collection…
copyleft · top 100 on PyPI
cryptographycryptography provides cryptographic recipes and…
permissive · top 100 on PyPI
rsaPure-Python RSA encryption, decryption,…
permissive · top 1,000 on PyPI
pyOpenSSLpyOpenSSL wraps OpenSSL's SSL/TLS functionality…
permissive · top 1,000 on PyPI
azure-identityProvides Microsoft Entra ID token-based…
unclear · top 1,000 on PyPI
PyNaClPyNaCl provides Python bindings to libsodium…
permissive · top 1,000 on PyPI
altchaCreates and verifies ALTCHA proof-of-work…
permissive · top 15,000 on PyPI
oauth2-clientHandles OAuth2 authentication flows…
unclear · top 15,000 on PyPI
requests-oauth2clientAn OAuth 2.x client for Python that obtains,…
permissive · top 5,000 on PyPI
srptoolsImplements Secure Remote Password (SRP)…
permissive · top 15,000 on PyPI
okta-jwt-verifierVerifies JWT tokens issued by Okta, checking…
permissive · top 15,000 on PyPI
spake2Implements SPAKE2, a password-authenticated key…
permissive · top 15,000 on PyPI
aioauthaioauth implements the OAuth 2.0 protocol for…
permissive · top 15,000 on PyPI
django-google-ssoAdds Google OAuth 2.0 authentication to Django…
permissive · top 15,000 on PyPI
pyxeroPyXero is a Python client library for the Xero…
permissive · top 15,000 on PyPI
requests-oauthAdds OAuth 1.0 authentication support to the…
permissive · top 5,000 on PyPI