Skip to main content

a4_printer_webserver

A single-printer web interface built with Flask and native WebSockets. It uses a4-printer-interface to discover the printer, monitor its activity, and submit PDF documents or images.

Installation

Python 3.10 or newer is required. The target printer must already be configured in the operating system.

python -m pip install a4_printer_webserver

First, list the available printers and their UUIDs:

python -m a4_printer_interface

Then start the website:

python -m a4_printer_webserver `
  --uuid "printer uuid" `
  --password "your password"

The server listens on http://127.0.0.1:5000 by default, and the default page title is Printer Website. To use a custom title:

python -m a4_printer_webserver `
  --uuid "8fd0d51f-12c8-5b50-a2f1-4f64641ae77c" `
  --password "your password" `
  --title "New Title"

Both --uuid and --password are required. An empty password is rejected. The following options are also available:

  • --host 127.0.0.1: Address on which the server listens. Use 0.0.0.0 to allow access from the local network.
  • --port 5000: TCP port on which the server listens.
  • --data-dir printer_data: Directory for uploaded files, the SQLite queue, and print history.
  • --max-upload-mb 100: Maximum size of one uploaded file, in MiB.
  • --auto-delete DAYS: Automatically delete submitted document files after a positive number of days. Automatic deletion is disabled when this option is omitted.

When exposing the service to a local network or the internet, place it behind an HTTPS-enabled reverse proxy. Passwords and documents should not cross an untrusted network over plain HTTP.

Behavior

  • Unauthenticated users can only access the login page. They cannot view the queue, download previously submitted files, or establish an authenticated WebSocket connection.
  • Uploading a document does not print it immediately. The user must click Print before the document enters the queue.
  • The Print test page button asks for confirmation before adding the built-in test page to the queue. It can be canceled until printing starts.
  • Pause printing prevents queued jobs from starting. It does not interrupt a job that is already printing, and the paused state resets when the server restarts.
  • Documents that have not started printing can be canceled. A document in the printing state cannot be canceled.
  • After the printing library returns successfully, the job is shown as Submitted. This means that the operating system accepted the job; it does not guarantee that the physical pages have finished printing.
  • A green light means the printer is idle, yellow means the printer or the current submission is busy, and red means that the configured UUID cannot be found or the print service status cannot be read.
  • While the printer reports that it is busy, the most recently submitted job remains in History but is displayed as Printing. It returns to Submitted when the printer becomes idle.
  • A submitted document can be deleted manually after confirmation. Manual and automatic deletion remove only the stored file; the History entry remains. Its Download button is then shown as disabled. Files for jobs currently shown as Printing, and built-in test-page jobs, do not offer a Delete button.
  • The queue and history are stored in SQLite. If the server stops unexpectedly, a job that was being submitted is marked as failed and is not printed again automatically.

Tests

python -m unittest discover -s tests -v

Metadata

Release files for a4-printer-webserver 0.1.5

For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.

Source distribution (sdist)

Source distribution for a4-printer-webserver 0.1.5
File Size Uploaded Provenance
a4_printer_webserver-0.1.5.tar.gz 30.9 kB Without provenance Details

Built distribution (wheel)

Table of built distributions (wheels) for a4-printer-webserver 0.1.5
File Interpreter ABI Platform
a4_printer_webserver-0.1.5-py3-none-any.whl Python 3 none any Details

Total release size: 59.1 kB

Release files / a4_printer_webserver-0.1.5.tar.gz

Download URL a4_printer_webserver-0.1.5.tar.gz
Size 30.9 kB
Tags Source
SHA-256 checksum
How to use checksums
d27dd95e161fae4060378f48439f43072fd4e9e384092bb6139c550a5223ee05
BLAKE2b-256 checksum
How to use checksums
19196b4e49e2a290ed21ba4edeb27fb2e04bbf2b86c4339d9f99f4fd62d90c64
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via uv/0.12.9 {"installer":{"name":"uv","version":"0.12.9","subcommand":["publish"]},"python":null,"implementation":{"name":null,"version":null},"distro":null,"system":{"name":null,"release":null},"cpu":null,"openssl_version":null,"setuptools_version":null,"rustc_version":null,"ci":null}

Release files / a4_printer_webserver-0.1.5-py3-none-any.whl

Download URL a4_printer_webserver-0.1.5-py3-none-any.whl
Size 28.1 kB
Tags Python 3
SHA-256 checksum
How to use checksums
8d48ee5d46a91f7dd491c1cabd896529234acf126a45dccd174f7016cf844a0d
BLAKE2b-256 checksum
How to use checksums
470f002a1f4ef6d1ccc70c839ed8ff3fe73065d4c4fde8966a8306edc0790276
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via uv/0.12.9 {"installer":{"name":"uv","version":"0.12.9","subcommand":["publish"]},"python":null,"implementation":{"name":null,"version":null},"distro":null,"system":{"name":null,"release":null},"cpu":null,"openssl_version":null,"setuptools_version":null,"rustc_version":null,"ci":null}

Security for a4-printer-webserver 0.1.5

Provenance

Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.

No provenance found

None of the files in this release were uploaded with provenance metadata.

A note on package security

PyPI is a repository for distributing packages, not a service for auditing them. While third-party security researchers and our staff do their best to detect and remove malicious packages, PyPI cannot guarantee the quality, security or suitability of any given package.

To learn more about protecting yourself from malicious actors, visit our package security documentation.

Anthropic, PBC Visionary sponsor Bloomberg Visionary sponsor Hudson River Trading Visionary sponsor Meta Visionary sponsor NVIDIA Visionary sponsor Microsoft Sustainability sponsor Depot Continuous Integration AWS Cloud computing and Security Sponsor Datadog Monitoring Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page