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.7

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.7
File Size Uploaded Provenance Actions
labelprint-1.0.7.tar.gz 7.3 kB Without provenance Details for labelprint-1.0.7.tar.gz

Built distribution (wheel)

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

Total release size: 14.3 kB

Release files / labelprint-1.0.7.tar.gz

Download URL labelprint-1.0.7.tar.gz
Size 7.3 kB
Tags Source
SHA-256 checksum
How to use checksums
65e2e998560b16671a2b1ac7855323e6cf09b1ee4e8a460cd2386f8d69936010
BLAKE2b-256 checksum
How to use checksums
ed7c2f67616084c6014e81312919bdb4f1deb60e35d021a35108e0327ffea7ea
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.7-py3-none-any.whl

Download URL labelprint-1.0.7-py3-none-any.whl
Size 7.0 kB
Tags Python 3
SHA-256 checksum
How to use checksums
7f2fa596ef72a65947d21c463a1640eac11c0805a0cf67596a088a8e9f5734ae
BLAKE2b-256 checksum
How to use checksums
afed79dace3e26674eab7b4ed374a1aa0016918663559f2b2e46cfe514adb538
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.7

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