WhyNotHugo / python-barcode

㊙️ Create standard barcodes with Python. No external dependencies. 100% Organic Python.
http://python-barcode.rtfd.io/
MIT License
572 stars 123 forks source link

Better way to validate barcode data? #155

Closed SeaDude closed 2 years ago

SeaDude commented 2 years ago

Hello,

Should I validate barcode data manually or is there a simple way using the library?

Example:

Thank you!

WhyNotHugo commented 2 years ago

Some barcodes validate the provided input. For example: https://github.com/WhyNotHugo/python-barcode/blob/962754e0de08821bd20e980aa79e5f692023b6c6/barcode/ean.py#L44-L54

Some have validation, others don't. If you have a snippet of code to validate any barcode that's missing a validation, I'm happy to include that.