Skip to content

mrueda/datamatrix2codes

Repository files navigation

datamatrix2codes logo

Excel-first GS1 DataMatrix parsing for Spanish pharmacy scanner workflows

datamatrix2codes

Parser for strings obtained from GS1 DataMatrix 2D barcodes, often called matriz de datos in Spain, on medicine boxes.

Build and test Documentation deploy Documentation Python License

datamatrix2codes helps pharmacists turn raw scanner strings from Spanish medicine packages into Excel columns such as PC, SN, LOTE, and CAD.

A scanner or app may read the GS1 DataMatrix image and send Excel the raw decoded string. That string is not four separate values; it is a GS1 payload made of Application Identifiers such as 01, 17, 10, and 21. The hard part is interpreting that payload, especially when variable-length fields such as lot (10) or serial (21) are followed by more fields. The same digit sequences can appear inside real values, so some strings cannot be split with certainty. This tool recovers what it can and marks uncertain rows for review.

Start Here

For Developers

python3 -m pip install -e .
python3 -m unittest discover -s tests -v
python3 -m py_compile src/datamatrix2codes/*.py tests/*.py
python3 -m datamatrix2codes data/codes.csv output.csv

The repository includes a synthetic-code generator so demos and tests can use realistic scanner strings without publishing real medicine-pack serials:

python3 tools/generate_synthetic_codes.py --count 20 > synthetic-codes.csv
python3 tools/generate_synthetic_codes.py --status ambiguous --count 20 > ambiguous-codes.csv

Docs checks:

cd docs-site
npm install
npm run typecheck
npm run build

Origin

I originally wrote this to help my sister, who is a pharmacist.

License

MIT. See LICENSE.

About

Parser for GS1 DataMatrix scanner strings from Spanish medicine boxes, with Excel support for pharmacy workflows

Topics

Resources

License

Stars

2 stars

Watchers

1 watching

Forks

Releases

No releases published

Packages

 
 
 

Contributors