python-jwt
Module for generating and verifying JSON Web Tokens
What it is and what it does
python-jwt is a module for creating and validating JSON Web Tokens, wrapping the cryptographic primitives provided by jwcrypto. It supports multiple signature algorithms including RS256, RS384, RS512, PS256, PS384, PS512, HS256, HS384, HS512, ES256, ES384, ES512, ES256K, and EdDSA. The package provides two main functions: generate_jwt to create signed tokens with a payload and expiration, and verify_jwt to validate a token's signature and extract its claims.
The package is now abandoned; the maintainer has stated they lack time to maintain it. The repository is archived and the last release was in November 2023. While the codebase has been tested for interoperability and includes unit tests, no active development or security updates are expected. Users considering this package should be aware that it will not receive bug fixes or security patches going forward.
Use it for:
- Generate and verify JWTs for stateless authentication in REST APIs or microservices.
- Implement token-based authorization where claims are embedded in the token itself.
- Interoperate with systems that use standard JWT algorithms like RS256 or HS256.
- Export and import cryptographic keys in PEM format for integration with external systems.
Worth the install?
AI-flagged interpretation of the facts on this page — verify before relying
Generates and verifies JSON Web Tokens (JWTs) using a variety of signature algorithms, delegating cryptographic operations to jwcrypto.
No. While the package is functionally complete and has low install friction, it is abandoned and no longer maintained. The maintainer explicitly states they lack time to maintain it, the repository is archived, and no updates have been released since November 2023. For new projects, use an actively maintained JWT library instead. For existing projects already using python-jwt, consider migrating to an alternative that receives security updates and bug fixes.
Install
python-jwt on PyPI
pip
pip install python-jwtuv
uv add python-jwtpoetry
poetry add python-jwtInstalling python-jwt
Before you install
Low install friction with a single runtime dependency. However, the package is abandoned and has not been maintained since November 2023; the repository is archived and the maintainer explicitly states they lack time to maintain it.
License in practice
MIT license is permissive and places no restrictions on use, modification, or distribution in commercial or private projects.
Quickstart
pip install python_jwt
import python_jwt as jwt
import jwcrypto.jwk as jwk
import datetime
key = jwk.JWK.generate(kty='RSA', size=2048)
payload = {'foo': 'bar'}
token = jwt.generate_jwt(payload, key, 'RS256', datetime.timedelta(minutes=5))
header, claims = jwt.verify_jwt(token, key, ['RS256'])
Requires Python 3.6 or later.
Verify before relying
- Whether the abandoned status and lack of maintenance since November 2023 poses a risk for new projects or production use.
- Current status of the CVE-2022-39227 vulnerability fix in version 4.1.0 and whether any newer issues have emerged post-abandonment.
Package facts
| License | MIT (permissive) |
| Python support | supports the current Python release (>=3.6) |
| Install friction | low — pure-Python wheel |
| Runtime dependencies | 1 — jwcrypto |
| Maintenance | abandoned — 1,005 days since the last release |
| Last repo commit | (repository archived) |
| First released | |
| Downloads | 373,971/month — #7,152 on PyPI (30-day window, as of 2026-08-14) |
| Known vulnerabilities | none known (OSV.dev, checked 2026-08-14) |
Evidence: python_jwt-4.1.0-py2.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
jwtEncodes and decodes JSON Web Tokens (JWTs) with…
permissive · top 5,000 on PyPI
myjwtA command-line tool for testing and…
permissive · top 15,000 on PyPI
scitokensImplements the SciTokens JSON Web Token (JWT)…
permissive · top 15,000 on PyPI
PyJWTPyJWT encodes and decodes JSON Web Tokens (JWT)…
permissive · top 100 on PyPI
joseImplements JSON Web Signature (JWS) and JSON…
permissive · top 15,000 on PyPI
vonage-jwtGenerates and verifies JWTs for Vonage API…
permissive · top 15,000 on PyPI
okta-jwt-verifierVerifies JWT tokens issued by Okta, checking…
permissive · top 15,000 on PyPI
jwskateImplements the JOSE family of IETF standards…
permissive · top 5,000 on PyPI
python-joseImplements JOSE (JSON Object Signing and…
permissive · top 1,000 on PyPI
paytmchecksumGenerates and verifies checksums for Paytm…
permissive · top 15,000 on PyPI