Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/shreyas-ashtamkar/batterystats
Simple python module to get the information regarding battery in python.
https://github.com/shreyas-ashtamkar/batterystats
battery battery-health battery-level python
Last synced: 2 months ago
JSON representation
Simple python module to get the information regarding battery in python.
- Host: GitHub
- URL: https://github.com/shreyas-ashtamkar/batterystats
- Owner: Shreyas-Ashtamkar
- Created: 2021-05-31T12:33:05.000Z (over 3 years ago)
- Default Branch: main
- Last Pushed: 2021-06-06T05:39:38.000Z (over 3 years ago)
- Last Synced: 2023-03-11T03:48:42.190Z (almost 2 years ago)
- Topics: battery, battery-health, battery-level, python
- Language: Python
- Homepage:
- Size: 62.5 KB
- Stars: 5
- Watchers: 2
- Forks: 1
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
Awesome Lists containing this project
README
![Image](icon.png)
# Battery Stats
![Build Status](https://github.com/Shreyas-Ashtamkar/battery-stats/actions/workflows/mytests.yml/badge.svg)A [python3](https://www.python.org/) 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](#where-can-we-use-this).
## 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](https://github.com/Shreyas-Ashtamkar/battery-stats/archive/refs/heads/main.zip), extract and directly use, as a module.)## Usage
##### code ( python3 )
```python
from batterystats import Batteryprint(Battery())
```##### outputs :
```shell
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