This is a Python package to create 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.10 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:
Links
Metadata
Release files for pybarcodes 1.2.4
For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.
Source distribution (sdist)
| File | Size | Uploaded | |
|---|---|---|---|
| pybarcodes-1.2.4.tar.gz | 13.4 kB | Details |
Built distribution (wheel)
| File | Interpreter | ABI | Platform | Reset |
|---|---|---|---|---|
| pybarcodes-1.2.4-py3-none-any.whl | Python 3 | none | any | Details |
Total release size: 26.0 kB
Release files / pybarcodes-1.2.4.tar.gz
| Download URL | pybarcodes-1.2.4.tar.gz |
|---|---|
| Size | 13.4 kB |
| Tags | Source |
|
SHA-256 checksum How to use checksums |
fb379cc04d3194f8defbe203679ac0cb49602168a1583a59ffa543b5a8456fbd
|
|
BLAKE2b-256 checksum How to use checksums |
5a7cbcaca20cc09e165a62d49b255cced527de73c49a9e502a85147b97a21827
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
Yes |
| Uploaded via |
twine/6.1.0 CPython/3.13.14
|
Provenance
Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.
PyPI Publish Attestation
PyPI verified that this artifact, at this checksum, originated from the publisher listed below.
Signed by GitHub Actions, verified by PyPI on Jul 22, 2026.
Transparency logRelease files / pybarcodes-1.2.4-py3-none-any.whl
| Download URL | pybarcodes-1.2.4-py3-none-any.whl |
|---|---|
| Size | 12.6 kB |
| Tags | Python 3 |
|
SHA-256 checksum How to use checksums |
2c6269199b642f3a2a0b533e775ebe634ed6dec13192be5e02fb7a181bff8c6e
|
|
BLAKE2b-256 checksum How to use checksums |
45b640b23a4d101794f74994c00f6146c12572b98728e1edbc77e4ba322008e0
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
Yes |
| Uploaded via |
twine/6.1.0 CPython/3.13.14
|
Provenance
Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.
PyPI Publish Attestation
PyPI verified that this artifact, at this checksum, originated from the publisher listed below.
Signed by GitHub Actions, verified by PyPI on Jul 22, 2026.
Transparency log