New Python System Information release!
I've just released a new version of PSI! PSI is a cross-platform Python package providing real-time access to processes and other miscellaneous system information such as architecture, boottime and filesystems. Among the highlights of this release are:
- Improved handling of time: We now have our own object to represent time. This may seem silly at first but it actually makes it easier to use all the normal ways of representing time easily as well as provide the highest possible accuracy.
- Improved handling of process names and arguments: There is an entire wiki page dedicated to this, but basically this simplifies presenting sensible process names to users massively since some attributes will always have meaningful values.
- Restructured exceptions: Whenever accessing attributes you will get a subclass of AttributeError like it should be so now you can happily use getattr().
- New experimental methods on Process objects: You can now send signals to processes using the .kill() method and find their children by using the .children() method.
- New experimental mount module: You can get detailed information about all mounted filesystems using this new module. It provides mount information as well as usage.
Another notable improvement is the ability to read the arguments of a 64-bit process while running inside a 32-bit python process on Solaris. It's small and almost no-one will notice it but make it so much more consistent!
Release early, release often: fail
Now for the bad news: all this means the API has changed in a backwards incompatible way.
It was already pretty obvious shortly after the last release that this would happen and was the reason I was hoping to release a new version soon. But that didn't happen. Although the last version had a "beta" version number on it it's trove classifier still claimed to be "alpha" and in end we don't promise API stability till we hit 1.0. But it's still not nice. Once we hit 0.3 we will actually try not to introduce changes to the API if possible. We intend to help this by using FutureWarning for APIs we're not sure about yet. In the mean time let's see how the Process API holds out during this release, hopefully it will prove to be good and require no more changes.
CreditsAs before, thanks to Chris Miles and Erick Tryzelaar for helping out.
5 comments:
Joseph said...
This is a cool project, I wish I had heard of this sooner. Do you have plans to provide the same kind of information top provides as well (maybe even everything the gnome system monitor provides)? My use case is a "health" monitoring system for servers and embedded devices.
Unknown said...
Everything to write top is available already, there is even a project using it to make a top-like program: http://bitbucket.org/chrismiles/psitop/ (not as active as PSI however).
Everything the gnome system monitor provides is planned, but not yet there :-)
holger krekel said...
Hey Florian. nice news. I am working a lot these days on http://codespeak.net/execnet and consider to use PSI to help with managing a network of procces. However, execnet is cross python/cross-platform and also works nicely with Windows. Do you have plans for offering (a limited) API on win32? cheers, holger
holger krekel said...
up, sorry, Floris, not Florian :)
Unknown said...
Yes, I am working on a windows port too. There is a branch and patch queue on bitbucket with this work in: http://bitbucket.org/flub/psi-win32 and http://bitbucket.org/flub/psi-win32-patches
Right now there isn't much about the processes yet (it's in the patch queue) but I want to concentrate on bringing win32 up to speed next. Since I'm not used to windows this will be a fairly slow struggle however.
Simply can't claim to be cross-platform and Python whithout supporting windows. :-)
New comments are not allowed.