Skip to main content

Automated barcode label generation and printing in Python

Project description

LabelPrint

Automated barcode label generation and printing in Python

Note: This package only works on Windows at the moment. With some minor rework, it could work on Linux too, that's just not a priority for my purposes at the moment.

Creating Labels

(More help coming soon)

Testing Labels

There are two ways to test your label layouts. You can write a simple Python script to generate a label, or you can add some code to your HTML file to import the script and create a preview when opened in your browser.

(More help coming soon)

Printing Labels

Printing your label with labelprint is easy! Simply call label.printPDF.

(More help coming soon)

Classes & Methods

label.py

  • make(htmlFile: str[, outFile: str|BinaryIO], data: dict) -> None|bytes
    If outFile is a BinaryIO object, the PDF is written into it.
    If outFile is None, raw PDF bytes are returned.
  • getPrinters() -> list[PrinterInfo]
  • printPDF(fileName: str, ptrName: str[, printOpts: dict]) -> None

Printer Info

Print Options

Name Type Description Default
width int Width of page in inches HTML page size
length int Length of page in inches HTML page size
size int Standard paper size code Set by printer
orientation str 'portrait' or 'landscape' Set by printer
dpi int Print quality in DPI Set by printer
dpiX int DPI for X axis only Set by printer
dpiY int DPI for Y axis only Set by printer
color bool Enable color printing True
scale int Scale factor in percent 100
copies int Number of copies 1

web.py

  • Options: dict
  • startDriver() -> ChromiumDriver Start webdriver or return current instance.
  • stopDriver(force=False) Shutdown webdriver in background after Options.timeout, or immediately if force is True.
  • getDriver() -> ChromiumDriver|None Get global webdriver instance.
  • get(uri: str, timeout: float) Get uri or raise TimeoutError if it can't be retrieved after timeout secs.

Global Options

Name Type Description Default
timeout float Secs to run in background 120
engine str Name of browser to use Edge
opts BaseOptions Custom webdriver options None
headless bool Run browser as headless True
silent bool Don't print any debug False

Project details


Download files

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

Source Distribution

labelprint-1.0.4.tar.gz (6.2 kB view details)

Uploaded Source

Built Distribution

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

labelprint-1.0.4-py3-none-any.whl (6.7 kB view details)

Uploaded Python 3

File details

Details for the file labelprint-1.0.4.tar.gz.

File metadata

  • Download URL: labelprint-1.0.4.tar.gz
  • Upload date:
  • Size: 6.2 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.1.0 CPython/3.12.9

File hashes

Hashes for labelprint-1.0.4.tar.gz
Algorithm Hash digest
SHA256 d181c9ad04d5be1d92e05258ae0048aefef7e437fa4cb5595d8d4b372ab0d94d
MD5 57f3dcd08665e7ab04b2e19afdb2c009
BLAKE2b-256 1b61bc77690fe81d4722bcbdd7ea54085369d24c6fceedcf0377652d52818c51

See more details on using hashes here.

File details

Details for the file labelprint-1.0.4-py3-none-any.whl.

File metadata

  • Download URL: labelprint-1.0.4-py3-none-any.whl
  • Upload date:
  • Size: 6.7 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.1.0 CPython/3.12.9

File hashes

Hashes for labelprint-1.0.4-py3-none-any.whl
Algorithm Hash digest
SHA256 848f181ed681359a5c6e6c9f5f2436a1a40dfc78852fcd9a0881bb7d5e6fe88b
MD5 a7ab85bb0c906bf70e07ec8c0d3c4cc2
BLAKE2b-256 0ee0b01a3f8609b8727684f173ac5fbae908d8fa729c0d65d28db39bbefc7434

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