Pure Python procps "watch" replacement
Project description
py-proc-watch
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 screenpy-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:
- simple
- fast for very long output of executed command
- easily tested for correct behavior
- pure Python to maximize the amount of supported systems
- 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:
isort
for keeping imports saneblack
for enforcing a consistent code styleflake8
withpyproject-flake8
for linting withpyproject.toml
supportmypy
for type checkingpytest
for running testpoethepoet
for easily running all of the above
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
Built Distribution
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
Algorithm | Hash digest | |
---|---|---|
SHA256 | edd124f47d7cb81200789f6de73966db4231ed86e4af674abd589b0bfb6e03c7 |
|
MD5 | 6fd0351edf4f069b86900ce81f84f1ca |
|
BLAKE2b-256 | 015d87722a5cd80543057da8eaa8da2a81f6a200f65bc41056f92d3a83754ccb |
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
Algorithm | Hash digest | |
---|---|---|
SHA256 | 1a787fc31acace166469042a2955e1d3f140809920131355e24a7b039743cddf |
|
MD5 | 0391bd8be323379e3e1d85ddbc8021f2 |
|
BLAKE2b-256 | c4c33250950add57314590a3bb76fc690dba8a82b96259c0819b60812bd53e96 |