Skip to content

Get a clear picture of your battery's health directly in Python. BatteryStats is a lightweight module designed to streamline the process of retrieving real-time battery data on your system.

Notifications You must be signed in to change notification settings

Shreyas-Ashtamkar/batterystats

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

57 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Image

Battery Stats

Build Status

A python3 module created for easily reading the current parameters of Battery in realtime. It reads battery stats from /sys/class/power_supply/ and returns. This module can be applied in a verity of projects.

Installation

Clone this repository into the same folder you want to write code in, and directly use it as a module. (or download the zip, extract and directly use, as a module.)

Usage

code ( python3 )
from batterystats import Battery

print(Battery())
outputs :
          Battery Information           
----------------------------------------
Date - Time  : 2021-06-01 | 12:44:06
Battery Path : /sys/class/power_supply/BAT0
Status       : Discharging
Capacity     : 63%
Charge Now   : 1469000
Charge Full  : 2311000

Where can we use this?

  • Get battery stats on command line
  • Scripts ( Alert/Report generation )
  • Other Python Applicaitons

About

Get a clear picture of your battery's health directly in Python. BatteryStats is a lightweight module designed to streamline the process of retrieving real-time battery data on your system.

Topics

Resources

Stars

Watchers

Forks

Languages