Skip to main content

fastnda logo


PyPI version License Python Versions Checks Coverage

Python and command-line tool to read Neware .nda and .ndax files fast.

Time to convert a ~100 MB, 1.3-million-row .ndax file to .csv. Best of three runs.
1) Cold start from command-line interface, including module imports.
2) Processing time only, without UI navigation.


This project is a fork of NewareNDA, and builds on top of projects neware_reader and nda-extractor. fastnda uses polars and parallelization to significantly reduce processing time.

Installation

Install from PyPI:

pip install fastnda
pip install fastnda[extras]  # If you want to write HDF5 files or use pandas

Using with Python

Import and use read for both .nda and .ndax files:

import fastnda

df = fastnda.read("my/neware/file.ndax")  # Returns a polars dataframe

df = df.to_pandas()  # If you prefer to work with pandas dataframes

metadata = fastnda.read_metadata("my/neware/file.ndax")  # Get metadata as a dictionary

Using the command-line interface

Use help to see functions, arguments, options:

fastnda --help          # See all functions
fastnda convert --help  # See how convert function works

The command-line interface can perform single-file or batch-file conversion to various formats:

fastnda convert "my/file.ndax"                          # Converts file to "my/file.csv"
fastnda convert "my/file.ndax" --columns=bdf            # Convert with battery-data-format style columns
fastnda convert "my/file.ndax" "output/file.parquet"    # Convert file to different location and format
fastnda convert "my/file.ndax" --format=arrow --pandas  # Convert to old-pandas-compatible arrow

fastnda batch-convert "my/folder/"                      # Convert all nda and ndax files in a folder to csv
fastnda batch-convert "my/folder/" --format=h5          # Convert all files to hdf5
fastnda batch-convert "my/folder/" --recursive          # Search all subfolders
fastnda batch-convert "my/folder/" "output/folder/"     # Save all files in a different folder

fastnda print-metadata "my/file.ndax"                   # Print metadata to terminal
fastnda convert-metadata "my/file.ndax"                 # Convert metadata to my/file.json
fastnda batch-convert-metadata "my/folder/" --recursive # Batch convert metadata

Help! My file can't be read / is converted incorrectly

Usually this is due to a hardware setting or a file type we have not seen before. Raise a GitHub issue here or on NewareNDA, send some test data, and we will add support.

Notes

This package adheres closely to the outputs from Neware's BTSDA, but there are some differences:

  • In Neware, capacity (and energy) is split into charge and discharge columns, and resets every step
  • fastnda records the net capacity (and energy), resetting every step
  • A negative current during charge will count negatively to the capacity, in Neware it is ignored
  • In some Neware files, cycles are only counted when the step index goes backwards
  • Here, a cycle is when a charge -> discharge has been completed
  • Change this behaviour with cycle_mode = x or --cycle-mode=x, where x is 'chg' | 'dchg' | 'auto' | 'raw'
  • Neware sometimes uses "DChg" and sometimes "Dchg" for discharge, here it is always "DChg"
  • Neware "Pulse Step" is here "Pulse"

Differences compared to NewareNDA

  • fastnda returns polars dataframes with different column names
  • There is only one capacity and one energy column
  • Time is explicitly split into step time and total time

Other benefits of using fastnda or NewareNDA over Neware's BTSDA:

  • Batch or automated file conversion is straightforward with Python or CLI
  • BTSDA drops precision depending on the units you select, e.g. exporting to V is less precise than exporting to mV
  • BTSDA can drop precision over time, e.g. after 1e6 seconds, all millisecond precision can be dropped
  • Different BTSDA versions need to be installed to open different .nda or .ndax files

Pandas compatibility

  • Old versions of pyarrow had an issue converting categorical columns to pandas, fixed in 23.0.0.
  • For compatibility with pandas in parquet/arrow/feather files, you can:
    • Update to pyarrow >= 23.0.0.
    • Convert to pandas first with to_pandas() or --pandas.
    • Use integer codes for the categorical columns with raw_categories=True or --raw-categories.

Contributions

If you have problems reading data, raise an issue on GitHub.

Code contributions are very welcome, clone the repo and use uv sync or pip install -e . --group dev for developer dependencies.

Acknowledgements

This project and its upstream NewareNDA are both made possible through community contributions from scientists with different ideas, equipment, and data. This fork explores larger, performance-focused changes that are difficult to land upstream incrementally. NewareNDA remains mature and actively maintained, and collaboration with the upstream project is ongoing.

This software was developed at the Laboratory of Materials for Energy Conversion at Empa, the Swiss Federal Laboratories for Materials Science and Technology, and supported by funding from the IntelLiGent project from the European Union’s research and innovation program under grant agreement No. 101069765, and from the Swiss State Secretariat for Education, Research, and Innovation (SERI) under contract No. 22.001422.

IntelLiGent logo IntelLiGent logo     EU flag     Swiss secretariat

Download files

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

Source Distribution

fastnda-1.3.0.tar.gz (34.2 kB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

fastnda-1.3.0-py3-none-any.whl (38.4 kB view details)

Uploaded Python 3

File details

Details for the file fastnda-1.3.0.tar.gz.

File metadata

  • Download URL: fastnda-1.3.0.tar.gz
  • Upload date:
  • Size: 34.2 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: uv/0.12.2 {"installer":{"name":"uv","version":"0.12.2","subcommand":["publish"]},"python":null,"implementation":{"name":null,"version":null},"distro":{"name":"Ubuntu","version":"24.04","id":"noble","libc":null},"system":{"name":null,"release":null},"cpu":null,"openssl_version":null,"setuptools_version":null,"rustc_version":null,"ci":true}

File hashes

Hashes for fastnda-1.3.0.tar.gz
Algorithm Hash digest
SHA256 5b60970e9acfa934396e790ce2641ebc03d48c38ce60fa89fe4aa4c3ba41b4a5
MD5 9c5e36df1378009ea605da5acba521b4
BLAKE2b-256 5abb180f9b9128a337417672162ee57ea94c2a75864de807a50f1d5c05771ef8

See more details on using hashes here.

File details

Details for the file fastnda-1.3.0-py3-none-any.whl.

File metadata

  • Download URL: fastnda-1.3.0-py3-none-any.whl
  • Upload date:
  • Size: 38.4 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: uv/0.12.2 {"installer":{"name":"uv","version":"0.12.2","subcommand":["publish"]},"python":null,"implementation":{"name":null,"version":null},"distro":{"name":"Ubuntu","version":"24.04","id":"noble","libc":null},"system":{"name":null,"release":null},"cpu":null,"openssl_version":null,"setuptools_version":null,"rustc_version":null,"ci":true}

File hashes

Hashes for fastnda-1.3.0-py3-none-any.whl
Algorithm Hash digest
SHA256 be9f039523bd043d87b07bfce7082fdbe908437145cf0d5b5766631b0fac14bc
MD5 7b9105773f6b3ce8774d765a3b4a9acb
BLAKE2b-256 ea72f21569fa25ad87c17aa0ce37a5b74cc26279d1afb21867ae3ace71a6d3bb

See more details on using hashes here.

Release history Release notifications | RSS feed

This release

1.3.0 This release

2 files

1.2.0

2 files

1.1.1

2 files

1.1.0

2 files

1.0.1

2 files

1.0.0

2 files

0.3.0

2 files

0.2.5

2 files

0.2.4

2 files

0.2.3

2 files

0.2.2

2 files

0.2.1

2 files

0.2.0

2 files

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page