Skip to main content

A simple package to generate EAN13 and EAN8

Project description

pyEanGenerator

Python package to:

  • generate ean8 and ean13 barcode
from pyEanGenerator import Ean8Generator,Ean13Generator

# EAN 8

testBarCode = Ean8Generator(myEan)

## show barecode on window
testBarCode.showBarcode()

## save EAN as svg file
testBarCode.saveAsSvg("myEan.svg")

## save EAN as png file (need pillow)
testBarCode.saveAsImg("myEan.png")

# EAN 13

testBarCode = Ean13Generator(myEan)

## show barecode on window
testBarCode.showBarcode()

## save EAN as svg file
testBarCode.saveAsSvg("myEan.svg")

## save EAN as png file (need pillow)
testBarCode.saveAsImg("myEan.png")
  • verify if a string can be an ean8 or ean13
from pyEanGenerator import isCorrectEan, EanType

# test if ean8 or ean13
isEan = isCorrectEan(myEan)

# test if ean8
isEan8 = isCorrectEan(myEan, EanType.EAN8)

# test if ean13
isEan13 = isCorrectEan(myEan, EanType.EAN13)
  • calculate checksum digit of ean
from pyEanGenerator import calculateDigitCheck

checkSumDigit = calculateDigitCheck(myEanWithouCheckSumDigit)

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

pyEanGenerator-1.0.0.tar.gz (5.9 kB view details)

Uploaded Source

File details

Details for the file pyEanGenerator-1.0.0.tar.gz.

File metadata

  • Download URL: pyEanGenerator-1.0.0.tar.gz
  • Upload date:
  • Size: 5.9 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/4.0.0 CPython/3.10.2

File hashes

Hashes for pyEanGenerator-1.0.0.tar.gz
Algorithm Hash digest
SHA256 b16e75812f988080b87966c8a09b31fc2b56f09098802471e3ed9d315af8c0c5
MD5 50371b05c6c1dabaeebe70dabd29ee91
BLAKE2b-256 0397c4feaf645a60d575e610c6b344e6837bbef04e72faced6e2d3d3e3a9e3e0

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