Package :
Installation :
pip install pybarcodes
Utilisation :
from pybarcodes import CODE39 barcode = CODE39("HELLO-WORLD") barcode.save("myimage.png")
Package :
Installation :
pip install code128
Utilisation :
import code128 code128.image("Hello World").save("hello.png")
Docs:
Installer la librairie libdmtx sur le système :
sudo apt install libdmtx0b
Installer les packages Python :
pip install pylibdmtx pip install pillow
Générer un Datamatrix :
from pylibdmtx.pylibdmtx import encode from PIL import Image encoded = encode("Hello world !".encode('utf8')) img = Image.frombytes('RGB', (encoded.width, encoded.height), encoded.pixels) img.save("example.png")
Source: https://www.youtube.com/watch?v=y9VXWsU3FSE
Package :
Installation :
pip install qrcode pip install pillow
Génération simple d'un QR Code :
import qrcode img = qrcode.make("Bonjour tout le monde !") img.save("exemple.png")
Génération d'un QR Code personnalisé :
import qrcode qr = qrcode.QRCode( box_size=20, border=10 ) qr.add_data("Hello world !") qr.make(fit=True) img = qr.make_image(fill_color="blue", back_color="white") img.save("example.png")