https://github.com/cptpcrd/pypsutil
A partial reimplementation of psutil in pure Python using ctypes.
https://github.com/cptpcrd/pypsutil
ctypes psutil python
Last synced: 5 months ago
JSON representation
A partial reimplementation of psutil in pure Python using ctypes.
- Host: GitHub
- URL: https://github.com/cptpcrd/pypsutil
- Owner: cptpcrd
- License: mit
- Created: 2020-08-04T02:04:23.000Z (almost 6 years ago)
- Default Branch: master
- Last Pushed: 2024-03-20T17:08:03.000Z (about 2 years ago)
- Last Synced: 2025-09-19T18:41:46.854Z (9 months ago)
- Topics: ctypes, psutil, python
- Language: Python
- Homepage:
- Size: 706 KB
- Stars: 2
- Watchers: 1
- Forks: 0
- Open Issues: 1
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
# pypsutil
[](https://pypi.org/project/pypsutil)
[](https://pypi.org/project/pypsutil)
[](https://pypsutil.readthedocs.io/en/latest/?badge=latest)
[](https://github.com/cptpcrd/pypsutil/actions?query=workflow%3ACI+branch%3Amaster+event%3Apush)
[](https://cirrus-ci.com/github/cptpcrd/pypsutil)
[](https://codecov.io/gh/cptpcrd/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.
[Documentation](https://pypsutil.readthedocs.io/en/latest/)
## 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()
>>> p.ppid()
477771
>>> p.parent()
Process(pid=477771, name='bash', status='sleeping', started='12:00:33')
```
More information is available in the [documentation](https://pypsutil.readthedocs.io/en/latest/).