Skip to main content

Android battery history analyZer

Project description

C

This is a battery history analyZer for android and compatible systems.

The package includes library functions for extracting battery data from collections of CSV files, as well as a helper CLI to generate charts from the terminal.

Installing

This is a python 3 package, and requires python 3.5. To install, type in the terminal:

pip3 install c

Configuration

There is nothing to configure in this package, but you must configure your android device to output CSV files in this format:

YYYY-MM-DD,HH.mm,!C,!D,!V,!C2

Special formats are defined as follows:

  • !C: the capacity ("percentage") of your battery at the time, from 0 to 100.
  • !D: whether your screen was on at the time, as on or off.
  • !V: the voltage of your battery, in microvolts. 4000000 means 4V.
  • !C2: the design capacity of the battery at the time.

The device must append a new entry every 10 minutes, specifically, whenever the time's minute mod 10 is 0.

Running

To see all graphs:

$ c overview

To see individual graphs:

$ c that_graph_name  # listed in cli.py

To see just the stats:

$ c stats
------------------------------  -------------  ------------  ---------
                                Last 395 days  Last 30 days  Last week
Data points                     52529          4165          826
Times charged to 100%           24             0             0
Times charged to 90%            72             14            0
Times charged to 80%            185            16            0
Time spent between 20%~80% (%)  94.26          92.29         100.0
Time spent between 45%~58% (%)  41.43          42.3          68.64
Average voltage (V)             3.88           3.91          3.91
Charge events*                  2344           134           37
Discharge events*               1305           74            18

Screen on per day (hrs)         7.63           2.63          1.74
  - Mondays                     7.5            3.17          0.33
  - Tuesdays                    7.35           1.5           0.83
  - Wednesdays                  6.81           1.79          0.83
  - Thursdays                   7.4            3.0           1.67
  - Fridays                     6.94           2.42          1.52
  - Saturdays                   8.26           3.9           5.65
  - Sundays                     9.23           2.72          4.11
------------------------------  -------------  ------------  ---------

If you are developing:

$ python -m c.cli

Name

C is one of the characters in one of my grandparents' names.

LicenSe

This project is licenSed under the GPL v3 licenSe.

Changelog

0.1.0

Add a capacity column.

0.0.6

Save figures only if the figs directory is available. Fix issue with blank files.

0.0.5

Fix command line when handling 'stats'.

0.0.3

Add an actual command line.

0.0.2

Fix execution in virtual envs with imports in relative paths.

0.0.1

Initial release.

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

c-0.1.0.tar.gz (10.2 kB view details)

Uploaded Source

Built Distribution

c-0.1.0-py3-none-any.whl (13.3 kB view details)

Uploaded Python 3

File details

Details for the file c-0.1.0.tar.gz.

File metadata

  • Download URL: c-0.1.0.tar.gz
  • Upload date:
  • Size: 10.2 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/1.11.0 pkginfo/1.4.2 requests/2.19.1 setuptools/39.2.0 requests-toolbelt/0.8.0 tqdm/4.23.4 CPython/3.5.2

File hashes

Hashes for c-0.1.0.tar.gz
Algorithm Hash digest
SHA256 c60adfe5dcd07a7023f53c5f29ba4113e54a9617725db1053c27c51fd6a37082
MD5 f6830c7a9c09f103699fb366c02381ba
BLAKE2b-256 fc5f1130c201f3138745970f8de520095a942cdd174e8f84faf04ce77c434d8d

See more details on using hashes here.

File details

Details for the file c-0.1.0-py3-none-any.whl.

File metadata

  • Download URL: c-0.1.0-py3-none-any.whl
  • Upload date:
  • Size: 13.3 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/1.11.0 pkginfo/1.4.2 requests/2.19.1 setuptools/39.2.0 requests-toolbelt/0.8.0 tqdm/4.23.4 CPython/3.5.2

File hashes

Hashes for c-0.1.0-py3-none-any.whl
Algorithm Hash digest
SHA256 ec579e31d9bb77cb57948b7e5da0e17ba706967a7e365b11bab14eebde723844
MD5 39a05b7bf987f9d6b9cbd63ab15e238c
BLAKE2b-256 38b7f394865ab27bc86b7b7638bb285d2cd5579843c8bca7931e77e07ca74eb3

See more details on using hashes here.

Supported by

AWS AWS Cloud computing and Security Sponsor Datadog Datadog Monitoring Fastly Fastly CDN Google Google Download Analytics Microsoft Microsoft PSF Sponsor Pingdom Pingdom Monitoring Sentry Sentry Error logging StatusPage StatusPage Status page