Skip to content

onemec/ThermalPrinter

Repository files navigation

Welcome to ThermalPrinter 👋

Documentation License: GPL--3.0--only

Enables printing simple web content (news, puzzles, etc.) to any ESC/POS thermal printer.

Pre-requisites

  • Install uv
  • Install Chromium within playwright with uv run playwright install chromium

Usage

uv run src/main.py --help

Basic Usage

Print content to your thermal printer:

uv run src/main.py sudoku weather

Dry Run Mode

Generate output files (HTML and PNG) without sending to the printer:

uv run src/main.py --dry-run sudoku

This creates temp.html and temp.png files that you can preview before printing.

Example Outputs

Here are examples of what the thermal printer output looks like:

Sudoku Puzzle

Sudoku Example

Weather Report

Weather Example

Printer Configuration

By default, the printer uses vendor ID 0x1fc9 and product ID 0x2016. To use a different printer, specify the IDs:

uv run src/main.py --vendor-id 0x1234 --product-id 0x5678 sudoku

Finding Your Printer's IDs

Follow the guide here.

Testing

uv run pytest

🤝 Contributing

Contributions, issues and feature requests are welcome!
Feel free to check issues page.

About

An IoT thermal printer in Python that prints news and other bits of info

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

 
 
 

Contributors