Skip to main content
Pre-release

This release is a pre-release and may not be stable for production use.

🌊 PyFlowBatt

This Python package contains functions and a CLI for analysing data from the flow battery lab at Empa.

Installation

Use Python >=3.10, and install with pip:

pip install pyflowbatt

Usage

Use in a terminal (e.g. Command Prompt or PowerShell).

To analyse the data in a folder, use

pyflowbatt --folder "path/to/your/folder"

Or go to a folder and just run pyflowbatt:

cd path/to/your/folder
pyflowbatt

PyFlowBatt processes the data, converts it to battery data format, makes summary graphs and Excel reports, and creates a BattINFO JSON-LD metadata file.

How to lay out data

Make one folder per sample (a "sample folder") and put raw data in it (not in subfolders). PyFlowBatt recognises each measurement from its file name, so the names need to contain _OCV_, _PEIS_, _LSV_, _GCPL_, _CVpre or _CVpost. If your files are named differently, you can change this in a pyflowbatt.toml file (see below).

You can run PyFlowBatt on one sample folder, or on a folder with many sample folders inside it:

my-experiment/               <- run pyflowbatt here
├── 261028_abcd_cell1/        <- a sample folder
│   ├── ..._01_OCV_CE4.mpr
│   ├── ..._02_PEIS_CE4.mpr
│   ├── ..._04_GCPL_CE4.mpr
│   ├── battinfo.xlsx        <- optional, from BattINFO Converter
│   └── results/             <- made by PyFlowBatt
├── 261028_abcd_cell2/       <- another sample folder
│   └── ...
└── combined_summary.xlsx    <- made by PyFlowBatt

Name each sample folder starting with the date and your initials, e.g. 250115_abcd_.... PyFlowBatt uses the folder name as the sample name in the summaries.

Sample folders can be grouped into subfolders, but don't put a sample folder inside another sample folder.

Zipping for Zenodo

If you use --zip, PyFlowBatt also makes a zip of everything, with a RO-Crate metadata file describing the files inside:

pyflowbatt --folder "path/to/your/folder" --zip

Several folders at once

You can analyse several folders in one go. Each folder is analysed as if run on its own (including the zip, if used).

pyflowbatt --folder "path/to/X" "path/to/Y" "path/to/Z"

You can also combine all those summaries from multiple folders into one Excel file: add --combined-summary with an .xlsx file, or a folder to write combined_summary.xlsx into (. for the current folder).

pyflowbatt --folder "path/to/X" "path/to/Y" "path/to/Z" --combined-summary "path/to/all_samples.xlsx"

Its "Summary" sheet lists every sample from all the folders, and its "By folder" sheet puts each folder's average and standard deviation side by side.

Checking before a long run

A full analysis can take a while. You can do a 'dry run' to check what files would be analysed, e.g.:

pyflowbatt --dry
pyflowbatt --dry --folder "path/to/your/folder" --zip

This is useful for checking everything is in order before running a long analysis.

Settings

You can override some settings by adding a pyflowbatt.toml file to a sample folder, parent folder, or your home folder. Use pyflowbatt init to create a template file and see what can be modified.

Using in Python

You can also use the functions in Python, e.g.

# Use individual functions
from pyflowbatt import gcpl, lsv, cv
from pyflowbatt.read import read_to_bdf

df = read_to_bdf("path/to/my/gcpl-file")
df, cycle_df = gcpl.analyse(df)

cv_df = read_to_bdf("path/to/my/cv-file")
cv_df, cv_cycle_df, capacitance_mF = cv.analyse(cv_df)

lsv_df = read_to_bdf("path/to/my/lsv-file")
lsv_result_dict = lsv.analyse(lsv_df)

# Or run the full analysis on folders
from pyflowbatt.analysis import analyse_sample, analyse_all_samples
analyse_sample("path/to/sample/folder")
analyse_all_samples("path/to/parent/folder/of/many/samples")

For contributors

If you find bugs, or want new features, open an issue on the GitHub page.

If you want to directly contribute to the project, it is easiest to use the tool 'uv':

git clone https://github.com/empaeconversion/pyflowbatt.git

cd pyflowbatt

uv sync

Then open this folder in an editor like VSCode.

You should always create a new branch before making edits, main is only for tested, working code that everyone can use.

E.g. make and switch to a new branch with

git checkout -b new-feature

You have now branched off the main PyFlowBatt into your own branch called e.g. new-feature. Now you can do whatever you like and it won't affect the main branch.

When you have made and committed some changes that add a feature or fix a problem, and you want to put them into main, open a pull request on GitHub.

Metadata

Release files for pyflowbatt 0.3.0rc2

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

Source distribution (sdist)

Source distribution for pyflowbatt 0.3.0rc2
File Size Uploaded Provenance Actions
pyflowbatt-0.3.0rc2.tar.gz 61.4 kB Without provenance Details for pyflowbatt-0.3.0rc2.tar.gz

Built distribution (wheel)

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

Total release size: 127.2 kB

Release files / pyflowbatt-0.3.0rc2.tar.gz

Download URL pyflowbatt-0.3.0rc2.tar.gz
Size 61.4 kB
Tags Source
SHA-256 checksum
How to use checksums
3e3ae1d7ef29addd7c5c80a9572ae7c4cfa4505d16c4396adf9f4265d15cc946
BLAKE2b-256 checksum
How to use checksums
770216f3993949d7fc3224829a5ea12cab143c1eb02aede2246dbbff1567a56b
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
Yes
Uploaded via uv/0.13.6 {"installer":{"name":"uv","version":"0.13.6","subcommand":["publish"]},"python":null,"implementation":{"name":null,"version":null},"distro":{"name":"Ubuntu","version":"26.04","id":"resolute","libc":null},"system":{"name":null,"release":null},"cpu":null,"openssl_version":null,"setuptools_version":null,"rustc_version":null,"ci":true}

Release files / pyflowbatt-0.3.0rc2-py3-none-any.whl

Download URL pyflowbatt-0.3.0rc2-py3-none-any.whl
Size 65.7 kB
Tags Python 3
SHA-256 checksum
How to use checksums
e54a9439435c707e83994b2ecb32848a54b53bc35b4d9a99c05853acdcf94f27
BLAKE2b-256 checksum
How to use checksums
b289cc8d9725c4986890942cdb4e64b281bd56667d0191a34c8029a1e3e5664c
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
Yes
Uploaded via uv/0.13.6 {"installer":{"name":"uv","version":"0.13.6","subcommand":["publish"]},"python":null,"implementation":{"name":null,"version":null},"distro":{"name":"Ubuntu","version":"26.04","id":"resolute","libc":null},"system":{"name":null,"release":null},"cpu":null,"openssl_version":null,"setuptools_version":null,"rustc_version":null,"ci":true}

Security for pyflowbatt 0.3.0rc2

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.

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