Skip to main content

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 Class name or binary path to engine Edge
opts BaseOptions Custom webdriver options None
headless bool Run browser as headless True
silent bool Don't print any debug False

Note: 'engine' must be Chromium-based, Firefox will fail.

Metadata

Release files for labelprint 1.0.8

For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.

Source distribution (sdist)

Source distribution for labelprint 1.0.8
File Size Uploaded Provenance Actions
labelprint-1.0.8.tar.gz 7.4 kB Without provenance Details for labelprint-1.0.8.tar.gz

Built distribution (wheel)

Table of built distributions (wheels) for labelprint 1.0.8
File Interpreter ABI Platform Actions
labelprint-1.0.8-py3-none-any.whl Python 3 none any Details for labelprint-1.0.8-py3-none-any.whl

Total release size: 14.5 kB

Release files / labelprint-1.0.8.tar.gz

Download URL labelprint-1.0.8.tar.gz
Size 7.4 kB
Tags Source
SHA-256 checksum
How to use checksums
5d1b5d7a12208775b0a23bedb3ee51d12a0a69a90a3b0e535eb482fe022952d2
BLAKE2b-256 checksum
How to use checksums
86c9299ff42464ffde665c0489b599d7a4fd6ffc720562f35c4eccc6cc1000a5
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/6.1.0 CPython/3.13.0

Release files / labelprint-1.0.8-py3-none-any.whl

Download URL labelprint-1.0.8-py3-none-any.whl
Size 7.1 kB
Tags Python 3
SHA-256 checksum
How to use checksums
a2e24c192cb6fefe0282981570332379aa0da4c6a8ab8e14294a42bc82d0f531
BLAKE2b-256 checksum
How to use checksums
b7ad2c5384d14978670761782418900d8524047c66b6f1b21c352fa2ab0fbb67
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/6.1.0 CPython/3.13.0

Security for labelprint 1.0.8

Provenance

Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.

No provenance found

None of the files in this release were uploaded with provenance metadata.

A note on package security

PyPI is a repository for distributing packages, not a service for auditing them. While third-party security researchers and our staff do their best to detect and remove malicious packages, PyPI cannot guarantee the quality, security or suitability of any given package.

To learn more about protecting yourself from malicious actors, visit our package security documentation.

Anthropic, PBC Visionary sponsor Bloomberg Visionary sponsor Hudson River Trading Visionary sponsor Meta Visionary sponsor NVIDIA Visionary sponsor Microsoft Sustainability sponsor Depot Continuous Integration AWS Cloud computing and Security Sponsor Datadog Monitoring Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page