Skip to main content

Tool to get the printers from a running CUPS instance

Project description

cups-printer

Retrieve all printers from a CUPS server. It's a simple command-line tool that allows one to output the existing printers or write them to a file.

Installation

It may require that the development package for CUPS is installed, e.g. $ sudo dnf -y install cups-devel.

PyPI

The package is hosted on PyPI. It depends on typer and pycups.

$ pip install cups_printer

Manual setup

$ python3 -m venv 
$ source bin/activate
$ python3 setup.py

Usage

The default CUPS instance which is used is localhost.

$ cups-printers --help

                                                                                                                           
 Usage: cups-printers [OPTIONS] COMMAND [ARGS]...                                                                          
                                                                                                                           
╭─ Options ───────────────────────────────────────────────────────────────────────────────────────────────────────────────╮
│ --server                    TEXT  The server URL of CUPS instance [env var: CUPS_SERVER] [default: localhost:631]       │
│ --timeout                   TEXT  Timeout for network operations [env var: TIMEOUT] [default: 5]                        │
│ --install-completion              Install completion for the current shell.                                             │
│ --show-completion                 Show completion for the current shell, to copy it or customize the installation.      │
│ --help                            Show this message and exit.                                                           │
╰─────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────╯
╭─ Commands ──────────────────────────────────────────────────────────────────────────────────────────────────────────────╮
│ output                                                                                                                  │
│ queue                                                                                                                   │
│ state                                                                                                                   │
╰─────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────╯

To get the details from a remote CUPS instance, use --server.

$ cups-printers --server 192.168.191.1:631 output json

License

cups-printers ìs license under MIT.

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

cups_printers-1.0.0.tar.gz (4.4 kB view details)

Uploaded Source

Built Distribution

cups_printers-1.0.0-py3-none-any.whl (7.2 kB view details)

Uploaded Python 3

File details

Details for the file cups_printers-1.0.0.tar.gz.

File metadata

  • Download URL: cups_printers-1.0.0.tar.gz
  • Upload date:
  • Size: 4.4 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/4.0.2 CPython/3.11.8

File hashes

Hashes for cups_printers-1.0.0.tar.gz
Algorithm Hash digest
SHA256 9a8fd0c83286ddb0d5b3a8ff932279b6588b0e4bd0f33dd170bfa9e36d8bebc1
MD5 594b5a2c721011e97480ffdb2d236daf
BLAKE2b-256 87eeaa59db82ef80239450282a2e5b2e67d831fb128775d2deeace7868d077af

See more details on using hashes here.

File details

Details for the file cups_printers-1.0.0-py3-none-any.whl.

File metadata

File hashes

Hashes for cups_printers-1.0.0-py3-none-any.whl
Algorithm Hash digest
SHA256 68510ec9b1e19840a0fa2bd477873046d0dca1b4ef90b75b672c012aacb09e96
MD5 46f5edaa722cc780502e4830a991048c
BLAKE2b-256 65c2320055391852bd5c4ecb592ead58425e4312d631653feb77460688528276

See more details on using hashes here.

Supported by

AWS AWS Cloud computing and Security Sponsor Datadog Datadog Monitoring Fastly Fastly CDN Google Google Download Analytics Microsoft Microsoft PSF Sponsor Pingdom Pingdom Monitoring Sentry Sentry Error logging StatusPage StatusPage Status page