Skip to main content

batsoc - State of Charge (Battery)

Got a cell voltage and would like to know how much charge is left? batsoc to the rescue!

Installation

pip install batsoc

Accuracy

Measuring state of charge based on voltage alone is not terribly accurate. The measured voltage depends on multiple factors besides the state of charge: temperature and load affect matters as well.

Usage

from batsoc import soc, BatteryType
soc(BatteryType.ALKALINE, 1.3)

will output 0.633 indicating 63.3% state of charge.

Supported batteries

ALKALINE

Any generic 1.5V alkaline battery under low load. The curve is defined for 0.8 - 1.6 volts.

LI_ION

Any generic lithium-ion battery with a nominal voltage of 3.7 or 3.8. The curve is defined for 3.0 - 4.2 volts.

CR2032

A 3V lithium coin cell battery under very low load. The curve is defined for 2.0 - 3.0 volts.

Metadata

Release files for batsoc 0.9.3

For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.

Source distribution (sdist)

Source distribution for batsoc 0.9.3
File Size Uploaded Provenance Actions
batsoc-0.9.3.tar.gz 6.2 kB Without provenance Details for batsoc-0.9.3.tar.gz

Built distribution (wheel)

Table of built distributions (wheels) for batsoc 0.9.3
File Interpreter ABI Platform Actions
batsoc-0.9.3-py3-none-any.whl Python 3 none any Details for batsoc-0.9.3-py3-none-any.whl

Total release size: 11.7 kB

Release files / batsoc-0.9.3.tar.gz

Download URL batsoc-0.9.3.tar.gz
Size 6.2 kB
Tags Source
SHA-256 checksum
How to use checksums
b6a210165654843d6278afe44da3d6ee58edc1773fa4968beffa6c8e665ab484
BLAKE2b-256 checksum
How to use checksums
fa00c5a9e48da35d882f3c504c462bd95e16e7dfac64d724dbed4e5377369bcf
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/4.0.2 CPython/3.11.5

Release files / batsoc-0.9.3-py3-none-any.whl

Download URL batsoc-0.9.3-py3-none-any.whl
Size 5.5 kB
Tags Python 3
SHA-256 checksum
How to use checksums
f7ab6a2b749a52e4fe6d7ad884b3da7cf825c01bd0c876053eb2517753816cc7
BLAKE2b-256 checksum
How to use checksums
888da46be871a7e4877abd7bf68cf44aa923e6b63ba05891bcfa12e085a97681
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/4.0.2 CPython/3.11.5

Security for batsoc 0.9.3

Provenance

Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.

No provenance found

None of the files in this release were uploaded with provenance metadata.

A note on package security

PyPI is a repository for distributing packages, not a service for auditing them. While third-party security researchers and our staff do their best to detect and remove malicious packages, PyPI cannot guarantee the quality, security or suitability of any given package.

To learn more about protecting yourself from malicious actors, visit our package security documentation.

Release history Release notifications | RSS feed

This release

0.9.3 This release

2 release files No provenance

Anthropic, PBC Visionary sponsor Bloomberg Visionary sponsor Hudson River Trading Visionary sponsor Meta Visionary sponsor NVIDIA Visionary sponsor Microsoft Sustainability sponsor Depot Continuous Integration AWS Cloud computing and Security Sponsor Datadog Monitoring Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page