Skip to main content

A simple library to get check digit

Project description

Get check digit number of your EAN-13 Barcode.

Here I’m presenting a package to find check digit (system generated digit) of 12 digit number which is used to create EAN-13 Barcode. When we used to create a barcode, the last digit always generated by our machine.In most of the cases, barcode number want to be unique and it is difficult to find if our new barcode number is already existing in our database without knowing this system generated digit and unfortunately I didn’t find any package to find this. That’s why I came accross to build a package to fing this crazy digit.

Installing

pip install check-digit-EAN13

Usage

from check_digit_EAN13.check_digit import get_check_digit

barcode_number = 123456565456 actual_barcode_number = get_check_digit(barcode_number) print(actual_barcode_number)

output

1234565654562

exceptions

case 1: You can’t use less than 12 digit here

barcode_number = 123456565 actual_barcode_number = get_check_digit(barcode_number)

output

sorry, please enter 12 digits

case 2: You can’t enter any character other than digits here

barcode_number = “123uu45656898895” actual_barcode_number = get_check_digit(barcode_number)

output

sorry, please enter 12 digit numbers

case 3: If you enter more than 12 digits, package only read 12 digits

barcode_number = 65623546325436473757847549875948 actual_barcode_number = get_check_digit(barcode_number)

output

6562354632541

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

check_digit_EAN13-0.1.tar.gz (3.1 kB view details)

Uploaded Source

File details

Details for the file check_digit_EAN13-0.1.tar.gz.

File metadata

  • Download URL: check_digit_EAN13-0.1.tar.gz
  • Upload date:
  • Size: 3.1 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/3.7.1 importlib_metadata/4.10.1 pkginfo/1.8.2 requests/2.26.0 requests-toolbelt/0.9.1 tqdm/4.62.3 CPython/3.9.7

File hashes

Hashes for check_digit_EAN13-0.1.tar.gz
Algorithm Hash digest
SHA256 37b4c44b57b4cddb9f47cdc2a6839c4c1b63780fd4b36f9f384942f12d32c444
MD5 71bd37136f8653271598be2be9e55640
BLAKE2b-256 3858a720fc9008c2050cf1974b7bf258e6d102886f64f2486ddf5dba300ad342

See more details on using hashes here.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Pingdom Monitoring Sentry Error logging StatusPage Status page