pyNGB - NETZSCH STA and Dilatometer File Parser
A high-performance Python library for parsing NETZSCH NGB files from STA (Simultaneous Thermal Analysis) instruments and push-rod dilatometers (DIL), with comprehensive metadata extraction and analysis tools.
⚠️ Disclaimer: This package is not affiliated with NETZSCH-Gerätebau GmbH. NETZSCH is a trademark of NETZSCH-Gerätebau GmbH.
Features
- Strict Binary Parsing: a record-grammar tokenizer parses every byte of the file — no pattern-match guessing (tens of milliseconds per file)
- Complete Metadata: Extract instrument settings, sample info, and experimental conditions
- Baseline Correction: Automatic baseline subtraction with validation, including the correction run embedded in Sample + Correction (
.ngb-ds3,.ngb-dla) files - Dilatometry: Dilatometer files (
.ngb-dla,.ngb-cla) with the corrected length change and dL/L0 that Proteus displays - DTG Analysis: Derivative thermogravimetry calculation with smoothing options
- Batch Processing: Parallel processing of multiple files
- Data Export: Convert data to Parquet or CSV; export metadata to JSON
- CLI Support: Command-line interface for automation
Installation
pip install pyngb
Quick Example
from pyngb import read_ngb
import polars as pl
import json
# Load NGB file with embedded metadata
table = read_ngb("experiment.ngb-ss3")
df = pl.from_arrow(table)
# Access data
print(f"Loaded {df.height} data points")
print(f"Temperature range: {df['sample_temperature'].min():.1f} to {df['sample_temperature'].max():.1f} °C")
# Access metadata
metadata = json.loads(table.schema.metadata[b'file_metadata'])
print(f"Sample: {metadata.get('sample_name', 'Unknown')}")
# Baseline correction
corrected = read_ngb("sample.ngb-ss3", baseline_file="baseline.ngb-bs3")
# Sample + Correction files (.ngb-ds3): raw sample run by default, the
# embedded correction run, or the corrected curves Proteus displays
raw = read_ngb("run.ngb-ds3")
corr = read_ngb("run.ngb-ds3", run="correction")
corrected = read_ngb("run.ngb-ds3", run="corrected")
# Dilatometer: corrected length change, then dL/L0
from pyngb import normalize_to_initial_length
dl_l0 = normalize_to_initial_length(read_ngb("run.ngb-dla", run="corrected"))
# DTG analysis
from pyngb.api.analysis import add_dtg
table_with_dtg = add_dtg(table, method="savgol", smooth="medium")
Command Line Usage
The CLI is available as the pyngb console script (or equivalently python -m pyngb):
# Convert single file
pyngb convert sample.ngb-ss3
# Batch processing with baseline correction
pyngb convert *.ngb-ss3 -b baseline.ngb-bs3 -f parquet -o ./processed/
# Inspect file structure / run data-quality checks
pyngb inspect sample.ngb-ss3
pyngb validate sample.ngb-ss3
# Get help
pyngb --help
Documentation
- Getting Started - Installation and first steps
- User Guide - Core functionality and examples
- API Reference - Complete function documentation
- Troubleshooting - Common issues and solutions
- Contributing - Development guidelines
License
MIT License. See LICENSE for details.
Support
- Issues: GitHub Issues
- Discussions: GitHub Discussions
Made with ❤️ for the scientific community
Metadata
Release files for pyngb 0.6.0
For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.
Source distribution (sdist)
| File | Size | Uploaded | Provenance | Actions |
|---|---|---|---|---|
| pyngb-0.6.0.tar.gz | 3.6 MB | With provenance | Details for pyngb-0.6.0.tar.gz |
Built distribution (wheel)
| File | Interpreter | ABI | Platform | Actions Reset |
|---|---|---|---|---|
| pyngb-0.6.0-py3-none-any.whl | Python 3 | none | any | Details for pyngb-0.6.0-py3-none-any.whl |
Total release size: 3.7 MB
Release files / pyngb-0.6.0.tar.gz
| Download URL | pyngb-0.6.0.tar.gz |
|---|---|
| Size | 3.6 MB |
| Tags | Source |
|
SHA-256 checksum How to use checksums |
b74497982fcf53dd67761849372360401d1b8eec5db9cf94601122045770e440
|
|
BLAKE2b-256 checksum How to use checksums |
c6fdb26890ca027b530ad3e25a7909e34144fdab089b414ff6ddea864d6e0e43
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
Yes |
| Uploaded via |
twine/7.0.0 CPython/3.13.14
|
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.
PyPI Publish Attestation
PyPI verified that this artifact, at this checksum, originated from the publisher listed below.
Signed by GitHub Actions, verified by PyPI on Sep 18, 2026.
Transparency logRelease files / pyngb-0.6.0-py3-none-any.whl
| Download URL | pyngb-0.6.0-py3-none-any.whl |
|---|---|
| Size | 105.3 kB |
| Tags | Python 3 |
|
SHA-256 checksum How to use checksums |
dedfaa7a9a11a4903600c759204dbf30805297aef6f742ca00ff08966f0eda99
|
|
BLAKE2b-256 checksum How to use checksums |
03f108e7d697f0947f115bd4b31428f31f426287d403bdac5ce9f5d458f0bff4
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
Yes |
| Uploaded via |
twine/7.0.0 CPython/3.13.14
|
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.
PyPI Publish Attestation
PyPI verified that this artifact, at this checksum, originated from the publisher listed below.
Signed by GitHub Actions, verified by PyPI on Sep 18, 2026.
Transparency logSecurity for pyngb 0.6.0
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.
Full provenance
Both files in this release have been uploaded with provenance metadata.
Attestation for pyngb-0.6.0.tar.gz
PyPI Publish Attestation
PyPI verified that this artifact, at this checksum, originated from the publisher listed below.
Signed by GitHub Actions, verified by PyPI on Sep 18, 2026.
Transparency logA 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.