Skip to main content

No project description provided

Project description

PyCUPS CLI

Allows to interact with CUPS in CLI using pycups. This script outputs the data in JSON, which allows to easily parse it in scripts with jq. For example getting a list of installed printers and their status is as simple as: pycupscli printers | jq -r 'keys[] as $k | "\($k): \(.[$k]["printer-state"])"'.

Usage

pycupscli [check, devices, printers, cancel, remove, add, info, print] -j jobid -p name -u uri -d driver -f file -o opts -a -s server -P port -U user

Where subcommands are:

  • check: check that the CUPS server is running and accessible, similar to lpstat -r
  • devices: returns a list of available devices, including network printers, similar to lpinfo -v
  • printers: returns the list of configured printers, similar to lpstat -v
  • cancel: cancels one or all jobs for a printer, requires -u uri and either -a or -j jobid
  • remove: remove a printer, requires either -u uri or -p name
  • add: add a printer, requires -u uri, -p name and -d driver
  • info: returns the attributes of an existing job or printer, requires -j jobid or -p name or -u uri
  • print: print a file, requires -p name and -f file, optionally -o opts with options seralized as a json object

The optional -s, -P and -U arguments allow to specify the CUPS address (or socker path), port and user.

The output of the script is just the raw data returned by pycups, serialized as json.

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

pycupscli-1.2.0.tar.gz (9.3 kB view details)

Uploaded Source

Built Distribution

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

pycupscli-1.2.0-py3-none-any.whl (10.5 kB view details)

Uploaded Python 3

File details

Details for the file pycupscli-1.2.0.tar.gz.

File metadata

  • Download URL: pycupscli-1.2.0.tar.gz
  • Upload date:
  • Size: 9.3 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: poetry/1.7.1 CPython/3.11.2 Linux/6.1.0-5-amd64

File hashes

Hashes for pycupscli-1.2.0.tar.gz
Algorithm Hash digest
SHA256 5b0943ae6e7274a2ed5e036fd3a7042a35958f74ffa61cb42d2786a68a79cf26
MD5 72086228b9308d87cfdcf5bd61d48cc8
BLAKE2b-256 8a7d5b62e41e1c3635f5ed525ef19b2751c340ac970ab4c76f76bc98de128a5b

See more details on using hashes here.

File details

Details for the file pycupscli-1.2.0-py3-none-any.whl.

File metadata

  • Download URL: pycupscli-1.2.0-py3-none-any.whl
  • Upload date:
  • Size: 10.5 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: poetry/1.7.1 CPython/3.11.2 Linux/6.1.0-5-amd64

File hashes

Hashes for pycupscli-1.2.0-py3-none-any.whl
Algorithm Hash digest
SHA256 b4ad51107c2696247d67760654462c33677079227023747edf3b87c4f5698bca
MD5 c566bbf6dc0fbb08e10d6e6ecbe01337
BLAKE2b-256 7ff814391fd6bc42fa71f889dcffabc6c372b2a60a094a8a7cbbec2b824c6f70

See more details on using hashes here.

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