Closed SeaDude closed 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.
Hello,
Should I validate barcode data manually or is there a simple way using the library?
Example:
ean13
codes must be 12 numeric digits orjan
codes must start with 45 or 49.I only found this out by testing the
barcode.ean.EuropeanArticleNumber13(barcode_data, writer=SVGWriter()).write(barcode_bytes)
andbarcode.ean.JapanArticleNumber(barcode_data, writer=SVGWriter()).write(barcode_bytes)
functionsIs there a "cheat sheet" of all the barcode requirements so I can roll-my-own validation? OR
Is there a better way to validate using the library itself?
Thank you!