luhn
Generate and verify Luhn check digits
Decision gist · record as of 2026-08-14
Yes, but with caution. The package does exactly what it claims and has no known vulnerabilities. MIT licensing is unrestricted. However, it is abandoned and has not been updated since 2015-06-23—install only if you are confident the Luhn algorithm implementation is correct for your use case and you can tolerate no future maintenance. For production payment systems, consider whether a maintained alternative would be safer.AI-flagged interpretation of the facts on this page — verify before relying
Before you install
- High install friction: the package has been abandoned since its only release on 2015-06-23, with no updates in many years.
- The last repository commit was 2023-03-14, suggesting minimal maintenance.
- No runtime dependencies, so installation itself is straightforward, but the stagnation raises questions about whether bugs or compatibility issues would be addressed.
License · maintenance · safety
MIT (permissive) — MIT license is permissive and imposes no restrictions on use, modification, or redistribution in commercial or private projects.
last release 2015-06-23 (4070 days) · last repo commit 2023-03-14 · 49 stars
0 known vulnerabilities (OSV.dev, 2026-08-14) · 178,384 downloads/mo, #10,195 on PyPI
Alternatives
Verify before relying
pip install luhn
from luhn import verify, generate, append
verify('356938035643809') # True
generate('53461861341123') # 4
append('53461861341123') # '534618613411234'- Whether the package works correctly with modern Python versions, given no updates since 2015-06-23 and no specified Python support in metadata.
- Whether the Luhn algorithm implementation matches current standards or has any known edge cases not covered by the fact sheet.
What it is and what it does
Luhn is a minimal Python library that implements the Luhn algorithm, a checksum formula used to validate identification numbers like credit card numbers. It provides three functions: `verify()` to check whether a digit string has a valid Luhn check digit, `generate()` to compute the correct check digit for a given number, and `append()` to return the number with its check digit appended.
The package has no external dependencies and is straightforward to use. However, it has been abandoned since its single release on 2015-06-23, with no updates for many years. While the algorithm itself is simple and unlikely to change, the lack of maintenance means any compatibility issues with newer Python versions or edge cases would not be addressed by the maintainer.
Use it for
- Validate credit card numbers or other financial identifiers that use Luhn checksums before processing.
- Generate correct check digits for test data or synthetic credit card numbers in development environments.
- Verify the integrity of digit sequences in payment systems or identity verification workflows.
- Append Luhn check digits to partial account numbers or identifiers in data generation pipelines.
Worth the install?
AI-flagged interpretation of the facts on this page. Verify before relying on it.
Yes, but with caution.
The package does exactly what it claims and has no known vulnerabilities. MIT licensing is unrestricted. However, it is abandoned and has not been updated since 2015-06-23—install only if you are confident the Luhn algorithm implementation is correct for your use case and you can tolerate no future maintenance. For production payment systems, consider whether a maintained alternative would be safer.
Install
luhn on PyPI
Before you install
High install friction: the package has been abandoned since its only release on 2015-06-23, with no updates in many years. The last repository commit was 2023-03-14, suggesting minimal maintenance. No runtime dependencies, so installation itself is straightforward, but the stagnation raises questions about whether bugs or compatibility issues would be addressed.
License in practice
MIT license is permissive and imposes no restrictions on use, modification, or redistribution in commercial or private projects.
Quickstart
pip install luhn
from luhn import verify, generate, append
verify('356938035643809') # True
generate('53461861341123') # 4
append('53461861341123') # '534618613411234'
Verify before relying
- Whether the package works correctly with modern Python versions, given no updates since 2015-06-23 and no specified Python support in metadata.
- Whether the Luhn algorithm implementation matches current standards or has any known edge cases not covered by the fact sheet.
Package facts
| License | MIT permissive |
| Python support | Not specified |
| Install friction | High. Source build required |
| Runtime dependencies | None |
| Maintenance | Abandoned 4,070 days since the last release |
| Last repo commit | |
| First released | |
| Downloads | 178,384 / month, #10,195 on PyPI 30-day window, as of 2026-08-14 |
| Known vulnerabilities | None known OSV.dev, checked 2026-08-14 |
Evidence: luhn-0.2.0.tar.gz
Tags
Let your AI agent find packages like this
Example. Real query, live index.
You found this page by searching. An agent finds it by wishing: SkillFed indexes 14,416 PyPI packages by what they can do, searchable in plain language.
wish › “luhn check digit validation”
- luhnGenerates and verifies Luhn check digits for digit strings, commonly…
- clabeValidates and generates CLABE numbers, Mexico's standard bank account…
- biipBiip parses and interprets data encoded in barcodes, including GTIN…
Give your agent the search over MCP, or paste the wish link into any chat.
More Cryptography packages
Certifi provides Mozilla's curated collection of root SSL certificates for Python applications to validate TLS hosts and verify certificate trustworthiness.
cryptography provides cryptographic recipes and low-level primitives for symmetric encryption, message digests, key derivation, and other common cryptographic algorithms in Python.
Pure-Python RSA encryption, decryption, signing, and key generation following PKCS#1 v1.5, with command-line and library interfaces.
pyOpenSSL wraps OpenSSL's SSL/TLS functionality for Python, providing high-level connection objects and certificate handling through a Python-friendly interface around OpenSSL's cryptographic operations.
Provides Microsoft Entra ID token-based authentication for Azure SDK clients through a set of TokenCredential implementations that handle OAuth flows and managed identity support.
PyNaCl provides Python bindings to libsodium for digital signatures, secret-key and public-key encryption, hashing, message authentication, and password-based key derivation.
See also paytmchecksum · python-stdnum · vonage-network-number-verification · lexid · brazilnum · inventree-ipn-generator · crc · text2digits · filehash · word2number