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

Nixpkgs

For Nix or NixOS users is a package available in Nixpkgs. Keep in mind that the lastest releases might only be present in the unstable channel.

$ nix-env -iA nixos.cups-printers

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.1.0.tar.gz (4.3 kB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

cups_printers-1.1.0-py3-none-any.whl (6.8 kB view details)

Uploaded Python 3

File details

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

File metadata

  • Download URL: cups_printers-1.1.0.tar.gz
  • Upload date:
  • Size: 4.3 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? Yes
  • Uploaded via: twine/6.1.0 CPython/3.13.12

File hashes

Hashes for cups_printers-1.1.0.tar.gz
Algorithm Hash digest
SHA256 4fb13d2f0b5048b1f1f88a3dc5e98c9632f1be0c8b1893d0c33cf0ac4814e795
MD5 4341a05ebad8da6391991631d7bee332
BLAKE2b-256 795fe6ce0b46814e0acfca94befd2b7121f13ee1e10cbddf11796d8a5117adf3

See more details on using hashes here.

Provenance

The following attestation bundles were made for cups_printers-1.1.0.tar.gz:

Publisher: publish-to-pypi.yml on audius/cups-printers

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

File details

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

File metadata

  • Download URL: cups_printers-1.1.0-py3-none-any.whl
  • Upload date:
  • Size: 6.8 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? Yes
  • Uploaded via: twine/6.1.0 CPython/3.13.12

File hashes

Hashes for cups_printers-1.1.0-py3-none-any.whl
Algorithm Hash digest
SHA256 8c0ac3e7702402672cd9eaeb7f71f7b01b1f6c9f26333356c16fa59c22caf4da
MD5 9b3f9f8bfbe6978fe745185acb07c749
BLAKE2b-256 a468d6d04d0e5edc181d91bd9f64d5aec6f50c2582eeb96a93a4e51c50cc1a31

See more details on using hashes here.

Provenance

The following attestation bundles were made for cups_printers-1.1.0-py3-none-any.whl:

Publisher: publish-to-pypi.yml on audius/cups-printers

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

Supported by

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