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
IfoutFileis a BinaryIO object, the PDF is written into it.
IfoutFileis None, raw PDF bytes are returned.getPrinters() -> list[PrinterInfo]printPDF(fileName: str, ptrName: str[, printOpts: dict]) -> None
Printer Info
pPrinterName: strDevice name (give this to printPDF)Offline: boolWhether the printer is offline- See MSDN for PRINTER_INFO_2 structure
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: dictstartDriver() -> ChromiumDriverStart webdriver or return current instance.stopDriver(force=False)Shutdown webdriver in background afterOptions.timeout, or immediately ifforceis True.getDriver() -> ChromiumDriver|NoneGet global webdriver instance.get(uri: str, timeout: float)Geturior raise TimeoutError if it can't be retrieved aftertimeoutsecs.
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
Built Distribution
Filter files by name, interpreter, ABI, and platform.
If you're not sure about the file name format, learn more about wheel file names.
Copy a direct link to the current filters
File details
Details for the file labelprint-1.0.5.tar.gz.
File metadata
- Download URL: labelprint-1.0.5.tar.gz
- Upload date:
- Size: 7.0 kB
- Tags: Source
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/6.1.0 CPython/3.13.0
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
57b9a677913af457786e4494c648c5ec560e5f37815ca4bfdb6079bf9d913709
|
|
| MD5 |
d177a21f39c21b21ab84e399f4f70d14
|
|
| BLAKE2b-256 |
f5dcdcd268379e41554e220454d41e1e2ea2a8fdef2e36025fe6f74cd4ab2877
|
File details
Details for the file labelprint-1.0.5-py3-none-any.whl.
File metadata
- Download URL: labelprint-1.0.5-py3-none-any.whl
- Upload date:
- Size: 7.1 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/6.1.0 CPython/3.13.0
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
333f19425968a65a19756d5a2e8b28b7ef18b7c9489e8031172d63fe5ccbf2a0
|
|
| MD5 |
84b2e3883953024cb1e73edf518bf52e
|
|
| BLAKE2b-256 |
6d986e2a1800e33ff8f08d7c32d68b8a16b40a1ae6b3200fa2209f904276c293
|