A Python package for cross-platform process management, providing process data as dicts/JSON and allowing process control (start, stop, kill) on Windows, Mac, and Linux.
Project description
Process Inspector
Overview
A Python package for cross-platform process management, providing process data as dicts/JSON and allowing process/service control (start, stop, kill) on Windows, Mac, and Linux (Raspberry Pi).
Installation
Use uv or pip.
uv add process-inspector
python3 -m pip install process-inspector
Development
To get a list of all commands with descriptions simply run make.
make env
make pip_install_editable
Testing
make pytest
make coverage
make open_coverage
Issues
If you experience any issues, please create an issue on Github.
Example Usage
from process_inspector import NativeApp
from process_inspector import Service
from process_inspector import Teamviewer
from process_inpsector import OperatingSystem
# App control
app = NativeApp('C:/Program Files (x86)/Microsoft/Edge/Application/msedge.exe')
app.open()
app.is_running()
app.get_version()
app.as_dict()
app.process_info()
app.close()
# Teamviewer
tv = Teamviewer()
tv.open()
tv.is_running()
tv.close()
tv.get_teamviewer_info()
# This operation requires sudo priveleges on Linux and Mac
# Service control
service = Service("Spooler")
service.start()
service.is_running()
service.stop()
# This operation requires sudo priveleges on Linux and Mac
OperatingSystem().reboot()
Use with Caution!
To control system services we need to allow passwordless use of specific executables. You should know the security implications of doing this so use at your own risk.
Linux
Use sudo visudo to add the following lines:
%sudo ALL=(ALL) NOPASSWD: /usr/bin/supervisorctl
%sudo ALL=(ALL) NOPASSWD: /usr/bin/systemctl
%sudo ALL=(ALL) NOPASSWD: /usr/sbin/reboot
Save and exit the file (:wq!). Then do:
sudo nano /etc/supervisor/supervisord.conf
Adjust the config so your user can access it:
[unix_http_server]
chmod=0770
chown=root:pi
Then restart supervisor:
sudo systemctl restart supervisor
macOS
Use sudo visudo to add the following lines:
%admin ALL=(ALL) NOPASSWD: /opt/homebrew/bin/supervisorctl
%admin ALL=(ALL) NOPASSWD: /sbin/reboot
Save and exit the file (:wq!).
History
All notable changes to this project will be documented in this file. This project adheres to Semantic Versioning.
0.1.0 (2025-09-11)
- First release
0.1.1 (2025-09-11)
- ADDED - more test coverage
0.1.2 (2025-09-11)
- ADDED - Service control (Windows Services or Linux/ Mac
supervisorctlprocesses) - ADDED - TeamViewer status and basic control (start, stop)
0.1.3 (2025-09-16)
- CHANGED - Improved query times for process running and process info
0.1.4 (2025-09-23)
- CHANGED - Fixed failing Linux tests
0.1.5 (2025-09-29)
- CHANGED -
get_process_infocan fail if the process was killed by the user within Windows/Mac. This fix handles that by resetting the cache so the process is looked up again.
Project details
Release history Release notifications | RSS feed
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
Filter files by name, interpreter, ABI, and platform.
If you're not sure about the file name format, learn more about wheel file names.
Copy a direct link to the current filters
File details
Details for the file process_inspector-0.1.5.tar.gz.
File metadata
- Download URL: process_inspector-0.1.5.tar.gz
- Upload date:
- Size: 23.6 kB
- Tags: Source
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/6.2.0 CPython/3.13.1
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
16653eba07a4bd87d301f95e9de23c8a83e4c8322bb4d5a2570db21a589128ab
|
|
| MD5 |
59894fee50f3e761a345c6f03a4190e2
|
|
| BLAKE2b-256 |
3a21414089ed085b97c1955bf9600e04543920127f7cbdd7228253339c5127bb
|
File details
Details for the file process_inspector-0.1.5-py3-none-any.whl.
File metadata
- Download URL: process_inspector-0.1.5-py3-none-any.whl
- Upload date:
- Size: 25.2 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/6.2.0 CPython/3.13.1
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
3037e2025835d5d75e1b22f5caacf95f8e219294b6fcce49e52c5a3425c7fe01
|
|
| MD5 |
bff3a197ea4784f065c8cff740839ec9
|
|
| BLAKE2b-256 |
96643f291861ba84df70969d81d178dafb742e366b0af0ae94a8102f50801b09
|