Metadata-Version: 2.4
Name: pyngb
Version: 0.3.0
Summary: Unofficial parser for NETZSCH STA (Simultaneous Thermal Analysis) NGB instrument binary files. Not affiliated with, endorsed by, or approved by NETZSCH-Gerätebau GmbH.
Project-URL: Homepage, https://github.com/GraysonBellamy/pyngb
Project-URL: Documentation, https://pyngb.graysonbellamy.dev/
Project-URL: Repository, https://github.com/GraysonBellamy/pyngb.git
Project-URL: Issues, https://github.com/GraysonBellamy/pyngb/issues
Project-URL: Changelog, https://github.com/GraysonBellamy/pyngb/blob/main/CHANGELOG.md
Author-email: Grayson Bellamy <gbellamy@umd.edu>
License-Expression: MIT
License-File: LICENSE
Keywords: binary-parsing,netzsch,ngb,scientific-data,sta,thermal-analysis,unofficial
Classifier: Development Status :: 3 - Alpha
Classifier: Intended Audience :: Science/Research
Classifier: Operating System :: OS Independent
Classifier: Programming Language :: Python :: 3
Classifier: Programming Language :: Python :: 3.10
Classifier: Programming Language :: Python :: 3.11
Classifier: Programming Language :: Python :: 3.12
Classifier: Programming Language :: Python :: 3.13
Classifier: Programming Language :: Python :: 3.14
Classifier: Topic :: Scientific/Engineering :: Chemistry
Classifier: Topic :: Scientific/Engineering :: Physics
Classifier: Typing :: Typed
Requires-Python: >=3.10
Requires-Dist: numpy>=1.24
Requires-Dist: polars>=1.6
Requires-Dist: pyarrow>=14
Requires-Dist: scipy>=1.13.1
Provides-Extra: docs
Requires-Dist: zensical>=0.0.46; extra == 'docs'
Description-Content-Type: text/markdown

# pyNGB - NETZSCH STA File Parser

[![PyPI version](https://badge.fury.io/py/pyngb.svg)](https://badge.fury.io/py/pyngb)
[![Python 3.10+](https://img.shields.io/badge/python-3.10+-blue.svg)](https://www.python.org/downloads/)
[![License: MIT](https://img.shields.io/badge/License-MIT-yellow.svg)](https://opensource.org/licenses/MIT)
[![Tests](https://github.com/GraysonBellamy/pyngb/workflows/Tests/badge.svg)](https://github.com/GraysonBellamy/pyngb/actions)

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

- **Fast Binary Parsing**: Optimized parsing with NumPy and PyArrow (typically well under a second per file)
- **Complete Metadata**: Extract instrument settings, sample info, and experimental conditions
- **Baseline Correction**: Automatic baseline subtraction with validation
- **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

```bash
pip install pyngb
```

## Quick Example

```python
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")

# 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`):

```bash
# Convert single file
pyngb sample.ngb-ss3

# Batch processing with baseline correction
pyngb *.ngb-ss3 -b baseline.ngb-bs3 -f parquet -o ./processed/

# Get help
pyngb --help
```

## Documentation

- **[Getting Started](docs/getting-started.md)** - Installation and first steps
- **[User Guide](docs/user-guide.md)** - Core functionality and examples
- **[API Reference](docs/api-reference.md)** - Complete function documentation
- **[Troubleshooting](docs/troubleshooting.md)** - Common issues and solutions
- **[Contributing](docs/contributing.md)** - Development guidelines

## License

MIT License. See [LICENSE](LICENSE) for details.

## Support

- **Issues**: [GitHub Issues](https://github.com/GraysonBellamy/pyngb/issues)
- **Discussions**: [GitHub Discussions](https://github.com/GraysonBellamy/pyngb/discussions)

---

Made with ❤️ for the scientific community
