I need to "encode" a string into a Datamatrix code image, and am struggling the whole day to find a way (library) to do it.
Does anyone know a good python library for Datamatrix code generation? Or a way to do it?"
Thanks!
I need to "encode" a string into a Datamatrix code image, and am struggling the whole day to find a way (library) to do it.
Does anyone know a good python library for Datamatrix code generation? Or a way to do it?"
Thanks!
pylibdmtx is still being updated actively and is now written in pure Python.pylibdmtx is no more up to date, and doesn't have support of FNC1 for GS1. treepoem have big (and still unsolved) problems with dependencies installation. Tried on win and linux.There is a library treepoem that allows conversion to most of the barcode types, which is being updated frequently.
https://pypi.org/project/treepoem/
eg: UPC-A,EAN-13,ISBN,PZN,I. 2 of 5,Code 39,Code 93,Code 128,Datamatrix,PDF417,QR,Micro QR, Aztec.
import treepoem
image = treepoem.generate_barcode(
barcode_type='datamatrix', # One of the supported codes.
data='barcode payload',
)
image.convert('1').save('barcode.png')
We also need to install ghostscript to run this.
https://www.ghostscript.com/download/gsdnld.html
For any errors while running in windows please follow the below link.