Skip to main content

Code for generating paperless ASN labels with QR codes

Project description

paperless-asn-qr-codes

paperless-asn-qr-codes is a command line utility for generating ASN labels for paperless with both a human-readable representation and a QR code for machine consumption. The labels are Avery 4731 labels by default.

Installation

pip install paperless-asn-qr-codes

In case you wanna use unrelease features, we also publish the main branch as development version to PyPi.

Usage

Run with uvx:

uvx paperless-asn-qr-codes

Run with uvx with a specific version, e.g. for pre-releases:

uvx --from paperless-asn-qr-codes==<version>

E.g. for dev15:

uvx --from paperless-asn-qr-codes==0.4.1dev15

Command Line Arguments:

usage: paperless-asn-qr-codes [-h] [--format {averyL4731,avery5160,avery5161,avery5163,avery5167,avery5371,herma10003}]
                              [--digits DIGITS] [--border] [--row-wise] [--num-labels NUM_LABELS] [--pages PAGES]
                              [--start-position START_POSITION]
                              start_asn output_file

CLI Tool for generating paperless ASN labels with QR codes

positional arguments:
  start_asn             The value of the first ASN
  output_file           The output file to write to (default: labels.pdf)

options:
  -h, --help            show this help message and exit
  --format, -f {avery5160,avery5161,avery5163,avery5167,avery5371,averyL4731,averyL4732,herma10003,herma4201,herma4346}
  --digits, -d DIGITS   Number of digits in the ASN (default: 7, produces 'ASN0000001')
  --border, -b          Display borders around labels, useful for debugging the printer alignment
  --row-wise, -r        Increment the ASNs row-wise, go from left to right
  --num-labels, -n NUM_LABELS
                        Number of labels to be printed on the sheet
  --pages, -p PAGES     Number of pages to be printed, ignored if NUM_LABELS is set (default: 1)
  --start-position, -s START_POSITION
                        Define the starting position on the sheet, eighter as ROW:COLUMN or COUNT, both starting from 1 (default: 1:1 or 1)

Mandatory arguments

  • <start_asn>: The value of the first ASN to generate

Optional arguments

  • <output_file>: The name of the output file to write to (default: labels.pdf)

  • -h, --help: Shows the help message
  • -f, --format: Selects the format of the output sheet (see Supported Sheets)
  • -d, --digits: Specifies the number of digits in the ASN (e.g. for the default number 7, the ASN will look like 'ASN0000001')
  • -b, --border: Generates the borders around the labels to help debug alignment issues (see Tips & Tricks)
  • -r, --row-wise: Increments the labels from left to right instead of top to bottom
  • -n, --num-labels: Number of labels to be printed on the sheet
  • -p, --pages: Number of pages to be generated, ignored if -n is present.
  • -s, --start-position: Positon of first label to be printed, either defined as ROW:COLUMN or NUMBER. Starting from 1 eg. to use the whole sheet it would be 1:1 or 1. Useful if you have a partly used sheet from using -n.

Supported Sheets

Some different sheet types are supported with the -f/--format argument, however, not all are tested.

The default is Avery L4731.

Currently tested and known working are:

  • Avery L4731 (189 Labels on DIN A4, the default)
  • Avery L4732 (80 Labels on DIN A4)
  • Avery 3657 (40 Labels on DIN A4)
  • Avery L7162 (manual cutting needed, 4 ASNs per Label)
  • Herma 10003 (80 Labels on DIN A4, formerly Herma 4345)
  • Herma 4201 (64 Labels on DIN A4, Disclaimer: Not perfect ;))
  • Herma 4346 (48 Labels on DIN A4)
  • Herma 4333 (189 Labes on DIN A4)

If you don't have label sheets at hand, you can also use:

  • genericA4large (70 Labels on plain DIN A4, manual cutting needed)

Tips & Tricks

In case your printer has alignment issues, you can generate a PDF with borders around the labels by using the -b/--border option.

Attribution

This script is based upon a public domain label generation class from @timrprobocom https://gist.github.com/timrprobocom/3946aca8ab75df8267bbf892a427a1b7

License

paperless-asn-qr-codes is distributed under the terms of the GPL-3.0 license.

Project details


Release history Release notifications | RSS feed

Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

paperless_asn_qr_codes-0.5.4.dev14.tar.gz (51.1 kB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

paperless_asn_qr_codes-0.5.4.dev14-py3-none-any.whl (19.9 kB view details)

Uploaded Python 3

File details

Details for the file paperless_asn_qr_codes-0.5.4.dev14.tar.gz.

File metadata

  • Download URL: paperless_asn_qr_codes-0.5.4.dev14.tar.gz
  • Upload date:
  • Size: 51.1 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: uv/0.11.8 {"installer":{"name":"uv","version":"0.11.8","subcommand":["publish"]},"python":null,"implementation":{"name":null,"version":null},"distro":{"name":"Alpine Linux","version":"3.23.4","id":null,"libc":null},"system":{"name":null,"release":null},"cpu":null,"openssl_version":null,"setuptools_version":null,"rustc_version":null,"ci":true}

File hashes

Hashes for paperless_asn_qr_codes-0.5.4.dev14.tar.gz
Algorithm Hash digest
SHA256 5172c8d3aa7c8de0a658187e6bb54fc3fe5a027e5c8166c9a2edc4a506f98fdf
MD5 8806dd9c7a120e553957af78e1851cc3
BLAKE2b-256 569437639e778e816cb1d54d90c8b2beee49ab8e91efaf9ce2de7b41ab65f638

See more details on using hashes here.

File details

Details for the file paperless_asn_qr_codes-0.5.4.dev14-py3-none-any.whl.

File metadata

  • Download URL: paperless_asn_qr_codes-0.5.4.dev14-py3-none-any.whl
  • Upload date:
  • Size: 19.9 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: uv/0.11.8 {"installer":{"name":"uv","version":"0.11.8","subcommand":["publish"]},"python":null,"implementation":{"name":null,"version":null},"distro":{"name":"Alpine Linux","version":"3.23.4","id":null,"libc":null},"system":{"name":null,"release":null},"cpu":null,"openssl_version":null,"setuptools_version":null,"rustc_version":null,"ci":true}

File hashes

Hashes for paperless_asn_qr_codes-0.5.4.dev14-py3-none-any.whl
Algorithm Hash digest
SHA256 f2627e115f7a6726b8493b89d50c8269e363f8d6123d87922f1ddef6ea494845
MD5 f5a99acd515aa1ceadc823a41a81dc0a
BLAKE2b-256 c0116253586036d93a7ac1c22500a2fb001f54e655a999f9b53630d661b39d3d

See more details on using hashes here.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Pingdom Monitoring Sentry Error logging StatusPage Status page