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
IfoutFile
is a BinaryIO object, the PDF is written into it.
IfoutFile
is None, raw PDF bytes are returned.getPrinters() -> list[PrinterInfo]
printPDF(fileName: str, ptrName: str[, printOpts: dict]) -> None
Printer Info
pPrinterName: str
Device name (give this to printPDF)Offline: bool
Whether 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: dict
startDriver() -> ChromiumDriver
Start webdriver or return current instance.stopDriver(force=False)
Shutdown webdriver in background afterOptions.timeout
, or immediately ifforce
is True.getDriver() -> ChromiumDriver|None
Get global webdriver instance.get(uri: str, timeout: float)
Geturi
or raise TimeoutError if it can't be retrieved aftertimeout
secs.
Global Options
Name | Type | Description | Default |
---|---|---|---|
timeout | float | Secs to run in background | 120 |
engine | str | Name of browser to use | Edge |
headless | bool | Run browser as headless | True |
silent | bool | Don't print any debug | False |
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
Built Distribution
File details
Details for the file labelprint-1.0.2.tar.gz
.
File metadata
- Download URL: labelprint-1.0.2.tar.gz
- Upload date:
- Size: 6.1 kB
- Tags: Source
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/5.1.1 CPython/3.10.11
File hashes
Algorithm | Hash digest | |
---|---|---|
SHA256 | 8d317830e400919b7e64cee84b81e0b5bee47a0ca66ed5c78909b4422e8ec350 |
|
MD5 | f08a0c66f1bbb5e64526499f7dde1033 |
|
BLAKE2b-256 | 2fd6119acb2576bc72ce6c23a7f91d7e2953efc61bdb0f4ea3a5919bec785b96 |
File details
Details for the file labelprint-1.0.2-py3-none-any.whl
.
File metadata
- Download URL: labelprint-1.0.2-py3-none-any.whl
- Upload date:
- Size: 6.6 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/5.1.1 CPython/3.10.11
File hashes
Algorithm | Hash digest | |
---|---|---|
SHA256 | 971467eb24b6e6cb6d513bd52601e7c6d368d145b323473e9a0f02d546c08b17 |
|
MD5 | 5f9219fc34c3ada0f05edab28735cc86 |
|
BLAKE2b-256 | cc170d2ea03f83e177880e0c389980efd40f319a286270e07569836a99163976 |