Skip to main content

A Python package for barcode generation

Project description

Documentation Status PyPI version info PyPI supported Python versions

This is a python package to create and read barcodes You can create file-like objects, text files and images from just a barcode number. Image generation is fast so it can be used to create images in bulk.

Supported Barcode Types

  • EAN13

  • EAN8

  • EAN14

  • JAN

  • CODE39

More types will soon be supported. PRs are welcome :)

Installing

Python 3.9 or higher is required

To install the library you can run the following command:

pip install pybarcodes

Quick Example

You can see what barcodes are supported

>>> import pybarcodes
>>> pybarcodes.SUPPORTED_BARCODES
['EAN13', 'EAN8', 'EAN14', 'JAN', 'CODE39']

And you can use this to view the barcode that was generated:

from pybarcodes import EAN13

CODE = "012345678905"
barcode = EAN13(CODE)
barcode.show()

This is pretty much all the code you need to generate a barcode.

Saving an image of the barcode is pretty straightforward.

from pybarcodes import EAN14

barcode = EAN14("40700719670720")

# Saves the image in PNG format
barcode.save("myimage.png")

# You can also resize it.
barcode.save("myimage2.png", size=(100000, 1000000))

EAN13 output from example 2:

Image of Barcode

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

pybarcodes-1.0.2.tar.gz (208.2 kB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

pybarcodes-1.0.2-py3-none-any.whl (209.9 kB view details)

Uploaded Python 3

File details

Details for the file pybarcodes-1.0.2.tar.gz.

File metadata

  • Download URL: pybarcodes-1.0.2.tar.gz
  • Upload date:
  • Size: 208.2 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.2.0 CPython/3.9.25

File hashes

Hashes for pybarcodes-1.0.2.tar.gz
Algorithm Hash digest
SHA256 4eac0f959d44c73aa8cd274d7c66a8337460ac0333a6bb40f906827c85bba7ff
MD5 22655f431f5dd970cfb4f8ea97fb4de9
BLAKE2b-256 53379e125de0a1ac9e962241a25b07a332ac35902e4505da0989192896f08415

See more details on using hashes here.

File details

Details for the file pybarcodes-1.0.2-py3-none-any.whl.

File metadata

  • Download URL: pybarcodes-1.0.2-py3-none-any.whl
  • Upload date:
  • Size: 209.9 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.2.0 CPython/3.9.25

File hashes

Hashes for pybarcodes-1.0.2-py3-none-any.whl
Algorithm Hash digest
SHA256 144147f793ba8476b701671e351b9111fca93360ae0986ae1c727d3a0c1ce262
MD5 7131e84d07d8deb7c63f7e8247fff68b
BLAKE2b-256 7288d37eed635160b57da5dde15f62ab3616857d3fbe6882891e0327ea6f7a67

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