A partial reimplementation of psutil in pure Python using ctypes.
Project description
pypsutil
A partial reimplementation of psutil in pure Python using ctypes. Currently, only Linux, macOS, and the BSDs are supported, but Windows support is planned.
Example usage
pypsutil
's API is very similar to psutil
's:
>>> import pypsutil
>>> p = pypsutil.Process()
>>> p.pid
477967
>>> p
Process(pid=477967, name='python3', status='running', started='12:00:40')
>>> p.name()
'python3'
>>> p.exe()
'/usr/bin/python3.9'
>>> p.cwd()
'/tmp'
>>> p.cmdline()
['python3']
>>> p.terminal()
'/dev/pts/6'
>>> p.status()
<ProcessStatus.RUNNING: 'running'>
>>> p.ppid()
477771
>>> p.parent()
Process(pid=477771, name='bash', status='sleeping', started='12:00:33')
More information is available in the documentation.
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
pypsutil-0.2.0.tar.gz
(78.4 kB
view hashes)
Built Distribution
pypsutil-0.2.0-py3-none-any.whl
(84.0 kB
view hashes)