checkdigit is a pure Python library built for identification numbers. You want to validate a credit card number, or maybe even calculate a missing digit on an ISBN code? We've got you covered 😎.
Want to know more? Check out the API Reference and documentation!
MacPorts 🍎
sudo port install py-checkdigit
PyPi 🐍
pip install checkdigit
- 📦 Works out of the box with all supported Python versions (3.7-3.11).
- ⌨️ PEP 561 compatible, with built in support for type checking.
- 🏃 Zero runtime dependencies. What you see is what you get.
- 🧮 Capable of calculating missing digits or validating a block of data.
- 📝 Extensive in-code comments and docstrings to explain how it works behind the scenes.
- Even/Odd binary parity
- CRC
- GS1 Standards
- EAN-8/13
- GDTI
- GLN
- SSCC
- UPC-A/E
- etc. (all fixed length numeric GS1 data structures with a check digit)
- ISBN-10/13
- Luhn
- Verhoeff
For each of these formats, we provide functions to validate them and calculate missing digits.
Do you have any formats that you'd like to see supported? 🤔 Feel free to raise an issue, or even to send a pull request!
This project follows the all-contributors specification. Contributions of any kind are welcome!
Want to help out? Check out the contributing page.
Thanks goes to these wonderful people (emoji key):
Timothy Langer |
Charlie Wilson 💻 |
Max Bowman 💻 |
Mohsen BANAN 🐛 |
This project is licensed under GPL-3.0-or-later.