Barcode Formatieren

Guten Morgen Leute,

Ich darf mich an dieser Stelle hilfesuchend an euch wenden. Ich komme leider nach intensiver Recherche leider nicht weiter.

Ich benötige für die Config Datei die richtige Schreibweise für die Extraktion einer Archivnummer aus einem „Code 39“ Barcode. Paperless kann das - nur Check ich die Formatierung für das Mapping nicht.

Der Barcode oben gibt folgende Werte aus 01XF1X0088633X01

Ich benötige als Archivnummer nur 7 Zahlen nach dem zweiten X

In paperless docs wird das mapping wie folgt beschrieben:


PAPERLESS_CONSUMER_TAG_BARCODE_MAPPING=<json dict>

Defines a dictionary of filter regex and substitute expressions.

Syntax: {"<regex>": "<substitute>" [,...]]}

A barcode is considered for tagging if the barcode text matches at least one of the provided pattern.

If a match is found, the rule is applied. This allows very versatile reformatting and mapping of barcode pattern to tag values.

If a tag is not found it will be created.

Defaults to:

{"TAG:(.*)": "\\g<1>"} which defines - a regex TAG:(.*) which includes barcodes beginning with TAG: followed by any text that gets stored into match group #1 and - a substitute \\g<1> that replaces the original barcode text by the content in match group #1. Consequently, the tag is the barcode text without its TAG: prefix.

More examples:

{"ASN12.*": "JOHN", "ASN13.*": "SMITH"} for example maps - ASN12nnnn barcodes to the tag JOHN and - ASN13nnnn barcodes to the tag SMITH.

{"T-J": "JOHN", "T-S": "SMITH", "T-D": "DOE"} directly maps - T-J barcodes to the tag JOHN, - T-S barcodes to the tag SMITH and - T-D barcodes to the tag DOE.

Please refer to the Python regex documentation for more information

Über eure Unterstützung würde ich mich sehr freuen.

Vielen Lieben Dank
Simon

Hallo Simon,

probiere doch mal folgendes: {„^(?:[^X]*X){2}(\d+)“: „\g<1>“}

VG Tom

Hey,

vielen Dank!

Hab ich probiert. Hat natürlich nicht funktioniert. Aber weil ich schon den Fehler gemacht habe APERLESS_CONSUMER_TAG_BARCODE_MAPPING= falsch zu interpretieren.

Der Präfix ist wohl nur dafür da, eine Datei einem Tag zuzuordnen und nicht eine ASN Nummer zu nehmen und zu verändern. Also alles Statisch und leider nicht dynamisch.

Möchte einfach vermeiden, alle Aufträge händisch eine ASN zu geben

[2025-07-25 13:01:35,424] [DEBUG] [paperless.barcodes] Scanning for barcodes using PYZBAR
[2025-07-25 13:01:35,449] [DEBUG] [paperless.barcodes] PDF has 16 pages
[2025-07-25 13:01:35,454] [DEBUG] [paperless.barcodes] Processing page 0
[2025-07-25 13:01:36,330] [DEBUG] [paperless.barcodes] Image is at /tmp/paperless/tmpredw9rqf/barcodeazu876b4/36976a4a-0d7c-4d8a-99b7-627fab6e8144-01.ppm
[2025-07-25 13:01:37,223] [DEBUG] [paperless.barcodes] Barcode of type CODE39 found: 01XF1X0064792X01
[2025-07-25 13:01:37,237] [DEBUG] [paperless.barcodes] Processing page 1
[2025-07-25 13:01:38,138] [DEBUG] [paperless.barcodes] Image is at /tmp/paperless/tmpredw9rqf/barcodeazu876b4/1c586e56-718e-494c-b41d-240769ef9f06-02.ppm
[2025-07-25 13:01:38,780] [DEBUG] [paperless.barcodes] Processing page 2
[2025-07-25 13:01:39,644] [DEBUG] [paperless.barcodes] Image is at /tmp/paperless/tmpredw9rqf/barcodeazu876b4/f95b51e5-fb0d-4698-abab-5b93a73246ad-03.ppm
[2025-07-25 13:01:40,198] [DEBUG] [paperless.barcodes] Processing page 3
[2025-07-25 13:01:40,975] [DEBUG] [paperless.barcodes] Image is at /tmp/paperless/tmpredw9rqf/barcodeazu876b4/37c9189f-3241-44a6-8723-0f135576b9cf-04.ppm
[2025-07-25 13:01:41,449] [DEBUG] [paperless.barcodes] Processing page 4
[2025-07-25 13:01:42,209] [DEBUG] [paperless.barcodes] Image is at /tmp/paperless/tmpredw9rqf/barcodeazu876b4/e696cfd9-2f1b-4f40-b543-d633251b51d9-05.ppm
[2025-07-25 13:01:42,742] [DEBUG] [paperless.barcodes] Processing page 5
[2025-07-25 13:01:43,508] [DEBUG] [paperless.barcodes] Image is at /tmp/paperless/tmpredw9rqf/barcodeazu876b4/c5447feb-e383-441e-969c-31867017dbc4-06.ppm
[2025-07-25 13:01:44,069] [DEBUG] [paperless.barcodes] Processing page 6
[2025-07-25 13:01:44,803] [DEBUG] [paperless.barcodes] Image is at /tmp/paperless/tmpredw9rqf/barcodeazu876b4/588dd838-1386-420a-a8bd-8331b54d0e95-07.ppm
[2025-07-25 13:01:45,181] [DEBUG] [paperless.barcodes] Processing page 7
[2025-07-25 13:01:45,919] [DEBUG] [paperless.barcodes] Image is at /tmp/paperless/tmpredw9rqf/barcodeazu876b4/6b65a199-8b16-44e4-a389-686fbc9751f7-08.ppm
[2025-07-25 13:01:46,335] [DEBUG] [paperless.barcodes] Processing page 8
[2025-07-25 13:01:47,136] [DEBUG] [paperless.barcodes] Image is at /tmp/paperless/tmpredw9rqf/barcodeazu876b4/dc472980-536e-4444-a24a-ab4f0fbc38b9-09.ppm
[2025-07-25 13:01:47,792] [DEBUG] [paperless.barcodes] Processing page 9
[2025-07-25 13:01:48,651] [DEBUG] [paperless.barcodes] Image is at /tmp/paperless/tmpredw9rqf/barcodeazu876b4/03f0b19a-ae66-4b9a-b845-007f72b32eaf-10.ppm
[2025-07-25 13:01:49,161] [DEBUG] [paperless.barcodes] Processing page 10
[2025-07-25 13:01:49,921] [DEBUG] [paperless.barcodes] Image is at /tmp/paperless/tmpredw9rqf/barcodeazu876b4/0e4b48ff-5401-47b7-b1ee-46e3d2176708-11.ppm
[2025-07-25 13:01:50,274] [DEBUG] [paperless.barcodes] Processing page 11
[2025-07-25 13:01:51,031] [DEBUG] [paperless.barcodes] Image is at /tmp/paperless/tmpredw9rqf/barcodeazu876b4/a4a5c6e2-73d8-4863-a334-c95b139fd954-12.ppm
[2025-07-25 13:01:51,445] [DEBUG] [paperless.barcodes] Processing page 12
[2025-07-25 13:01:52,223] [DEBUG] [paperless.barcodes] Image is at /tmp/paperless/tmpredw9rqf/barcodeazu876b4/ecf9205e-d723-4973-9cff-75d4bc603d6f-13.ppm
[2025-07-25 13:01:52,950] [DEBUG] [paperless.barcodes] Processing page 13
[2025-07-25 13:01:53,703] [DEBUG] [paperless.barcodes] Image is at /tmp/paperless/tmpredw9rqf/barcodeazu876b4/5eb88b6b-dd7e-47f9-9eb9-908526c8199d-14.ppm
[2025-07-25 13:01:54,153] [DEBUG] [paperless.barcodes] Processing page 14
[2025-07-25 13:01:54,992] [DEBUG] [paperless.barcodes] Image is at /tmp/paperless/tmpredw9rqf/barcodeazu876b4/35117518-cd8b-469c-8d12-180630953d7c-15.ppm
[2025-07-25 13:01:55,456] [DEBUG] [paperless.barcodes] Processing page 15
[2025-07-25 13:01:56,277] [DEBUG] [paperless.barcodes] Image is at /tmp/paperless/tmpredw9rqf/barcodeazu876b4/96d4f475-105d-42e6-abfb-8fcd3ec751b1-16.ppm
[2025-07-25 13:01:56,599] [INFO] [paperless.tasks] BarcodePlugin completed with no message
[2025-07-25 13:01:56,602] [DEBUG] [paperless.tasks] Executing plugin WorkflowTriggerPlugin
[2025-07-25 13:01:56,613] [INFO] [paperless.tasks] WorkflowTriggerPlugin completed with:
[2025-07-25 13:01:56,616] [DEBUG] [paperless.tasks] Executing plugin ConsumeTaskPlugin

Am meisten stört mich die Stelle BarcodePlugin completed with no message

Chears

Dieses Thema wurde automatisch 7 Tage nach der letzten Antwort geschlossen. Es sind keine neuen Antworten mehr erlaubt.