Huge News!Announcing our $40M Series B led by Abstract Ventures.Learn More
Socket
Sign inDemoInstall
Socket

labelprint

Package Overview
Dependencies
Maintainers
1
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

labelprint

Automated barcode label generation and printing in Python

  • 1.0.2
  • PyPI
  • Socket score

Maintainers
1

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

  • pPrinterName: str Device name (give this to printPDF)
  • Offline: bool Whether the printer is offline
  • See MSDN for PRINTER_INFO_2 structure

Print Options

NameTypeDescriptionDefault
widthintWidth of page in inchesHTML page size
lengthintLength of page in inchesHTML page size
sizeintStandard paper size codeSet by printer
orientationstr'portrait' or 'landscape'Set by printer
dpiintPrint quality in DPISet by printer
dpiXintDPI for X axis onlySet by printer
dpiYintDPI for Y axis onlySet by printer
colorboolEnable color printingTrue
scaleintScale factor in percent100
copiesintNumber of copies1

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

NameTypeDescriptionDefault
timeoutfloatSecs to run in background120
enginestrName of browser to useEdge
headlessboolRun browser as headlessTrue
silentboolDon't print any debugFalse

FAQs


Did you know?

Socket

Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.

Install

Related posts

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc