Skip to main content

pyNGB - NETZSCH STA and Dilatometer File Parser

PyPI version Python 3.10+ License: MIT Tests

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

License

MIT License. See LICENSE for details.

Support


Made with ❤️ for the scientific community

Metadata

Release files for pyngb 0.6.1

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

Source distribution (sdist)

Source distribution for pyngb 0.6.1
File Size Uploaded Provenance Actions
pyngb-0.6.1.tar.gz 3.6 MB With provenance Details for pyngb-0.6.1.tar.gz

Built distribution (wheel)

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

Total release size: 3.7 MB

Release files / pyngb-0.6.1.tar.gz

Download URL pyngb-0.6.1.tar.gz
Size 3.6 MB
Tags Source
SHA-256 checksum
How to use checksums
68ce65e6e8faad101e26c16a87f422b489fd8a78d706eeb591ced8f488f2912b
BLAKE2b-256 checksum
How to use checksums
712b3cd4820e6775544294b1ff9ab3230cb01816edadae77963d48297464beed
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 Oct 20, 2026.

Transparency log

Release files / pyngb-0.6.1-py3-none-any.whl

Download URL pyngb-0.6.1-py3-none-any.whl
Size 105.4 kB
Tags Python 3
SHA-256 checksum
How to use checksums
6a09b0317f150df4bfadeacf664533a6fc53d174feda9ea8265dfee05da3893f
BLAKE2b-256 checksum
How to use checksums
a9e22ec2821f558c2b62af1da1babd04e6efd545c4c86092bf227b6a0c51be1c
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 Oct 20, 2026.

Transparency log

Security for pyngb 0.6.1

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.

Select from 2 files

Attestation for pyngb-0.6.1.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 Oct 20, 2026.

Transparency log

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