Access to ioreg using Python? Is there a way to access the values ioreg utility accesses via Python?

What i'm looking is to add monitoring of the battery status of my Magic Mouse. I know I can get it by using

ioreg -c AppleDeviceManagementHIDEventService -r -l | grep -E '"Product"|BatteryPercent' 


So -- what's the magic to get the value of BatteryPercent into Python, without launching ioreg via subprocess?
The ioreg utility uses IOKit to get the values for for example the battery status of the Magic Mouse.

You can access IOKit from Python using ctypes - a foreign function library for Python. It allows you to call C/Objective C functions etc. from Python.

You can see an example of how to that with IOKit here:

https://github.com/pudquick/pypmset/blob/master/pypmset.py

In addition you'll find that someone already creeated a wrapper for IOKit to be accessible from Python here:

https://github.com/mosen/moobjc-framework-IOKit