You do not need to use any module for this.
You can just go to
/ Sys / class / power_supply / bat0.
Here you will find many files with information about your battery. You will receive the current charge in the charge_now file and the total charge in the charge_full file. Then you can calculate the percentage of battery using math.
Note: - You may need root access for this. You can use the sudo nautilus command to open directories in root mode.
source share