psu-progs
A collection of utilities to put a computer-connected power supplies to good use.
The extraordinarily compact collection includes only a CLI tool for charging lithium-ion batteries with a Korad PSU.
Installation
pip install psu-progs
Quick-show-me-a-thing
# Charge a 1400mAh lithium-ion battery, with a Korad PSU connected at /dev/ttyACM0
korad-charge-lithium-ion -p /dev/ttyACM0 -c 1.4
Full command help
Usage: korad-charge-lithium-ion [OPTIONS]
Charge a Li-ion battery using a Korad K300XP power supply
Options:
-p, --port DEVICE Name of serial device the power supply can be
communicated through, e.g. /dev/ttyACM0
[default: /dev/ttyUSB1; required]
-c, --capacity FLOAT Labeled capacity of battery, in amp hours.
[required]
--charge-current FLOAT Current to use while in the constant-current
charging phase, in amps. If not specified,
this defaults to half the battery_capacity.
--charge-voltage FLOAT Voltage to use while in constant-voltage
phase. For Li-ion cells, this value should be
≤4.2. [default: 4.2]
--charge-cutoff-ratio FLOAT Ratio of the charge_current used to derive
the value of measured output current at which
to stop charging. [default: 0.1]
--channel INT Which channel to output power from (for power
supplies with multiple channels). [default:
0; 0<=x<=1]
--num-samples INT When measuring current, use the average of
this many number of samples. Using a value
over 1 is recommended, as anomalous blips may
be measured. This also addresses low readings
when output is first enabled. [default: 3;
x>=0]
--max-successive-failures INT After this number of continuous errors are
encountered while attempting to read the
output current, stop charging. [default: 5;
x>=0]
--help Show this message and exit.
Developing
This package uses poetry for dependency management. To get started hacking around the codebase:
- Create a new virtualenv (or skip this step and let poetry do it for you)
pip install poetrypoetry install- Good luck!
Contributing
If you have other utilities you'd like to add, or other PSUs you'd like to support, pull requests are welcomed! I may not be able to physically test all contributions, but I sure can review and merge :)
Metadata
Release files for psu-progs 0.1.1
For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.
Source distribution (sdist)
| File | Size | Uploaded | |
|---|---|---|---|
| psu_progs-0.1.1.tar.gz | 7.8 kB | Details |
Built distribution (wheel)
| File | Interpreter | ABI | Platform | Reset |
|---|---|---|---|---|
| psu_progs-0.1.1-py3-none-any.whl | Python 3 | none | any | Details |
Total release size: 16.1 kB
Release files / psu_progs-0.1.1.tar.gz
| Download URL | psu_progs-0.1.1.tar.gz |
|---|---|
| Size | 7.8 kB |
| Tags | Source |
|
SHA-256 checksum How to use checksums |
9d561b982ded2a729f254eb8df6c79e657e82b436479db4f118f1343f17aed90
|
|
BLAKE2b-256 checksum How to use checksums |
967706048e7548d1204d217bdf6b80f5281acfd903bcaf7620e8397deb8730a5
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
poetry/1.2.2 CPython/3.9.14 Linux/5.13.0-52-generic
|
Release files / psu_progs-0.1.1-py3-none-any.whl
| Download URL | psu_progs-0.1.1-py3-none-any.whl |
|---|---|
| Size | 8.4 kB |
| Tags | Python 3 |
|
SHA-256 checksum How to use checksums |
4821c6ef5bd7fc387125c9ff66047d6cd5270082e87a094037a5da059f575fce
|
|
BLAKE2b-256 checksum How to use checksums |
602e9bdf2e93b07d7ecbb8d274827a2c5e3ea1ae348b257f34508e282d236cbd
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
poetry/1.2.2 CPython/3.9.14 Linux/5.13.0-52-generic
|