Skip to main content

pyNGB - NETZSCH STA File Parser

PyPI version Python 3.10+ License: MIT Tests

A high-performance Python library for parsing NETZSCH STA (Simultaneous Thermal Analysis) NGB files 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) files
  • 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")

# 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

Download files

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

Source Distribution

pyngb-0.5.0.tar.gz (2.4 MB view details)

Uploaded Source

Built Distribution

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

pyngb-0.5.0-py3-none-any.whl (96.1 kB view details)

Uploaded Python 3

File details

Details for the file pyngb-0.5.0.tar.gz.

File metadata

  • Download URL: pyngb-0.5.0.tar.gz
  • Upload date:
  • Size: 2.4 MB
  • Tags: Source
  • Uploaded using Trusted Publishing? Yes
  • Uploaded via: twine/6.1.0 CPython/3.13.7

File hashes

Hashes for pyngb-0.5.0.tar.gz
Algorithm Hash digest
SHA256 ab7e8b2b77a920ed36fcb6505724c3e6a21e3b75b8e1cdd059e84b4d08bb836e
MD5 01c72212bbb935a3375e65782bc7e572
BLAKE2b-256 07df96362200063f2fe7b4f3d5986a30f959d97aca2fb9316436c8b12e344345

See more details on using hashes here.

Provenance

The following attestation bundles were made for pyngb-0.5.0.tar.gz:

Publisher: ci-cd.yml on GraysonBellamy/pyngb

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

File details

Details for the file pyngb-0.5.0-py3-none-any.whl.

File metadata

  • Download URL: pyngb-0.5.0-py3-none-any.whl
  • Upload date:
  • Size: 96.1 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? Yes
  • Uploaded via: twine/6.1.0 CPython/3.13.7

File hashes

Hashes for pyngb-0.5.0-py3-none-any.whl
Algorithm Hash digest
SHA256 3b06808e435c9413a61c9511959f9775577ff5ef5df6f682c10a9fdc8d716eb2
MD5 006b70d32b015cfe43d6a49274c373ce
BLAKE2b-256 b06ee9b7b7fe1250b683bc1a828cdec05c37f1a334f6a4c5b7e3e2bb65684a64

See more details on using hashes here.

Provenance

The following attestation bundles were made for pyngb-0.5.0-py3-none-any.whl:

Publisher: ci-cd.yml on GraysonBellamy/pyngb

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

Release history Release notifications | RSS feed

This release

0.5.0 This release

2 files

0.4.0

2 files

0.3.0

2 files

0.2.0

2 files

0.1.2

2 files

0.1.1

2 files

0.1.0

2 files

0.0.3

2 files

0.0.2

2 files

0.0.1

2 files

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