Skip to main content

Pure Python procps "watch" replacement

Project description

py-proc-watch

PyPI version

Library and command line tool for watching process output. This is more or less a simpler version of watch from procps.

The main differences come from defaults:

  • py-proc-watch always trims long lines so they fit on the screen
  • py-proc-watch respects color ANSI escape sequences (but strips the rest)
  • Python or C for the implementation

Design goals

py-proc-watch library and tool should be:

  1. simple
  2. fast for very long output of executed command
  3. easily tested for correct behavior
  4. pure Python to maximize the amount of supported systems
  5. easy to use in other tools

Usage

pywatch command line tool supports only a few command line options to keep it simple:

usage: pywatch.py [-h] [-n INTERVAL] [-p] [-v] command [command ...]

positional arguments:
  command               command to watch, can be specified as a quoted string or as a list (use -- to separate pywatch and command options)

options:
  -h, --help            show this help message and exit
  -n INTERVAL, --interval INTERVAL
                        seconds to wait between command runs, positive floats and zero are accepted
  -p, --precise         try to run the command precisely at intervals
  -v, --debug           show debug information

py_proc_watch can be used also as a Python module to provide "watch-like" functionality easily. The library is quite simple, so just read the source and tests.

Development

py-proc-watch uses Python Poetry to manage dependencies.

Used tools:

The magic incantation:

poetry run poe check

will run all of the lint and test tools for you.

Contributing and reporting issues

Please use GitHub Issues and Pull requests. If you're contributing code please see Development section.

License

MIT, see LICENSE.md for full text. This is very permissive license, see following pages for more information:

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

py-proc-watch-0.2.0.tar.gz (8.6 kB view details)

Uploaded Source

Built Distribution

py_proc_watch-0.2.0-py3-none-any.whl (6.2 kB view details)

Uploaded Python 3

File details

Details for the file py-proc-watch-0.2.0.tar.gz.

File metadata

  • Download URL: py-proc-watch-0.2.0.tar.gz
  • Upload date:
  • Size: 8.6 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: poetry/1.2.1 CPython/3.10.7 Windows/10

File hashes

Hashes for py-proc-watch-0.2.0.tar.gz
Algorithm Hash digest
SHA256 edd124f47d7cb81200789f6de73966db4231ed86e4af674abd589b0bfb6e03c7
MD5 6fd0351edf4f069b86900ce81f84f1ca
BLAKE2b-256 015d87722a5cd80543057da8eaa8da2a81f6a200f65bc41056f92d3a83754ccb

See more details on using hashes here.

File details

Details for the file py_proc_watch-0.2.0-py3-none-any.whl.

File metadata

  • Download URL: py_proc_watch-0.2.0-py3-none-any.whl
  • Upload date:
  • Size: 6.2 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: poetry/1.2.1 CPython/3.10.7 Windows/10

File hashes

Hashes for py_proc_watch-0.2.0-py3-none-any.whl
Algorithm Hash digest
SHA256 1a787fc31acace166469042a2955e1d3f140809920131355e24a7b039743cddf
MD5 0391bd8be323379e3e1d85ddbc8021f2
BLAKE2b-256 c4c33250950add57314590a3bb76fc690dba8a82b96259c0819b60812bd53e96

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