Add your description here
Project description
Print Dog
Watch a directory and automatically print PDF files as soon as they finish downloading.
Install
Install directly from the source checkout (editable):
pip install -e .
Once published to PyPI, anyone can install with:
pip install print-dog
Usage
Run the watcher with the console script that gets installed:
print-dog /path/to/watch --printer My_Printer
The folder argument is optional; if omitted the watcher monitors ~/Downloads. Use --log-level DEBUG for verbose logging.
If you omit --printer, the system default printer is used. Set it via lpoptions -d <printer-name> or list printers with lpstat -p.
Windows + SumatraPDF
To avoid per-user paths when using SumatraPDF:
print-dog "C:\Users\%USERNAME%\Downloads" --use-sumatra
--use-sumatra searches the common installation folders (%LOCALAPPDATA%, %PROGRAMFILES%, etc.) or the path pointed to by the SUMATRAPDF_PATH environment variable. Override the location or CLI flags when needed:
--sumatra-path "C:\Custom\SumatraPDF\SumatraPDF.exe"--sumatra-args "-print-to \"Office Printer\" -silent"
Filter by filename
Limit processing to PDFs whose names start with specific prefixes:
print-dog --allow-prefix Invoice --allow-prefix Statement
Only files beginning with Invoice or Statement will be printed. Supply --allow-prefix multiple times to add prefixes.
Slow downloads
The watcher waits for a PDF to stabilise before printing. Tweak the behaviour when downloads are large or networks are slow:
print-dog --download-timeout 1200 --stable-checks 6 --poll-interval 1.5
--download-timeout(seconds) controls the maximum time to wait.--stable-checksis the number of consecutive unchanged size checks required.--poll-interval(seconds) adjusts how often the file size is checked.- Temporary files such as
.crdownloador.partare ignored until they disappear, so browsers that rename at the end (Chrome, Edge, Firefox) are handled gracefully.
Testing without a printer
-
Use
--dry-runto simulate printing while keeping the watcher logic intact. -
Or provide a custom command that receives the file path, e.g.:
print-dog --print-command "echo printing {file}"
Environment variables and ~ are expanded automatically inside --print-command, so Windows users can rely on %LOCALAPPDATA%\SumatraPDF\SumatraPDF.exe.
Building a distribution
Use python -m build (requires pip install build) to produce source and wheel distributions that can be uploaded to PyPI with twine upload dist/*. The resulting package installs the print-dog command on macOS, Linux, and Windows.
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
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 print_dog-0.1.2.tar.gz.
File metadata
- Download URL: print_dog-0.1.2.tar.gz
- Upload date:
- Size: 6.3 kB
- Tags: Source
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/6.2.0 CPython/3.12.10
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
cab4aa40299c13b3ca8b2330c649829a6ba42e925b0a01b5614ee76a82c2c55b
|
|
| MD5 |
94c1a74d95358406edd8822c56113c84
|
|
| BLAKE2b-256 |
285b1126c52dbeb893690ffa94c1bedd79ad29e7d5703488a80f57ee7c615e30
|
File details
Details for the file print_dog-0.1.2-py3-none-any.whl.
File metadata
- Download URL: print_dog-0.1.2-py3-none-any.whl
- Upload date:
- Size: 6.8 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/6.2.0 CPython/3.12.10
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
2b1a46ca9149924e0bf38b25164f973d598df7b618cc09d494dc164419dbb1d3
|
|
| MD5 |
afe33fc1ad1375218fe418c7f0d6485c
|
|
| BLAKE2b-256 |
e26c448f53ecd7edf5f8f1900c3b0b97c226a6eca330fee8ecddd07a35867a12
|