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.
As before, thanks to Chris Miles and Erick Tryzelaar for helping out.