Metadata-Version: 2.4
Name: tecio-python
Version: 0.1.1
Summary: Python interface for reading and writing Tecplot data files
Project-URL: Homepage, https://github.com/meersman/tecio
Project-URL: Documentation, https://meersman.github.io/tecio/
Project-URL: Repository, https://github.com/meersman/tecio
Project-URL: Issues, https://github.com/meersman/tecio/issues
Project-URL: Changelog, https://github.com/meersman/tecio/blob/main/docs/changelog.md
Keywords: tecplot,tecio,cfd,data,visualization,szplt,plt
Classifier: Development Status :: 3 - Alpha
Classifier: Intended Audience :: Science/Research
Classifier: Intended Audience :: Developers
Classifier: Topic :: Scientific/Engineering
Classifier: Topic :: Scientific/Engineering :: Visualization
Classifier: Environment :: Console
Classifier: Programming Language :: Python :: 3
Classifier: Programming Language :: Python :: 3.11
Classifier: Programming Language :: Python :: 3.12
Classifier: Programming Language :: Python :: 3.13
Classifier: Typing :: Typed
Classifier: License :: OSI Approved :: Apache Software License
Classifier: Operating System :: OS Independent
Requires-Python: >=3.10
Description-Content-Type: text/markdown
License-File: LICENSE
License-File: NOTICE
Requires-Dist: numpy
Provides-Extra: dev
Requires-Dist: build; extra == "dev"
Requires-Dist: twine; extra == "dev"
Requires-Dist: ruff; extra == "dev"
Requires-Dist: ty; extra == "dev"
Requires-Dist: pytest; extra == "dev"
Requires-Dist: pytest-cov; extra == "dev"
Provides-Extra: docs
Requires-Dist: sphinx>=7.0; extra == "docs"
Requires-Dist: sphinx-book-theme>=1.1; extra == "docs"
Requires-Dist: sphinx-autodoc-typehints>=2.0; extra == "docs"
Requires-Dist: myst-parser>=3.0; extra == "docs"
Provides-Extra: mat
Requires-Dist: scipy; extra == "mat"
Dynamic: license-file

# tecio

[![License](https://img.shields.io/badge/License-Apache%202.0-blue.svg)](LICENSE)
[![CI](https://github.com/meersman/tecio/actions/workflows/ci.yml/badge.svg)](https://github.com/meersman/tecio/actions/workflows/ci.yml)
[![Codecov](https://codecov.io/gh/meersman/tecio/branch/main/graph/badge.svg)](https://codecov.io/gh/meersman/tecio)
[![Docs](https://github.com/meersman/tecio/actions/workflows/docs.yml/badge.svg)](https://meersman.github.io/tecio)
[![PyPI](https://img.shields.io/pypi/v/tecio-python)](https://pypi.org/project/tecio-python)
[![Python](https://img.shields.io/pypi/pyversions/tecio-python)](https://pypi.org/project/tecio-python)

Python interface for reading and writing Tecplot data files.

## Overview

`tecio` wraps Tecplot's TecIO C library to provide a Python API for reading
and writing Tecplot binary formats (`.szplt`, `.plt`) and ASCII (`.dat`). It
also includes command-line tools for common file operations such as converting
formats, extracting zones, and computing statistics.

**Requirements:** Python 3.10+, NumPy, Tecplot 360 (or the standalone TecIO library)

---

## Installation

```bash
pip install tecio-python
```

The TecIO shared library (`libtecio.so` / `libtecio.dylib`) is not bundled
with this package and must be provided separately via a Tecplot 360
installation or the standalone TecIO library. Set the `TECIO_LIB` environment
variable to point to the library if it is not on your system path:

```bash
export TECIO_LIB=/path/to/libtecio.so     # Linux
export TECIO_LIB=/path/to/libtecio.dylib  # macOS
```

## Quick start

```python
import tecio
import numpy as np

x = np.linspace(0, 2 * np.pi, 100)
y = np.sin(x)

with tecio.open("sine.szplt", "w") as tec:
    tec.write_ijk_zone(data=[x, y], variables=["x", "y"])
```

Reading a file:

```python
with tecio.open("sine.szplt", "r") as tec:
    print(tec.variables)   # ['x', 'y']
    x = tec.zone[0].variable[0].values
    y = tec.zone[0].variable[1].values
    # or
    x, y = tec.zone[0].get_array(["x", "y"])
```

## API

All file access goes through `tecio.open`, which selects the correct
format handler from the file extension and returns a context manager:

| Mode | Description |
|------|-------------|
| `"r"` | Read an existing file |
| `"w"` | Write a new file |
| `"x"` | Write, failing if the file already exists |
| `"a"` | Append new zones to an existing file |
| `"a+"` | Append and read in the same session |

Supported formats:

| Extension | Format |
|-----------|--------|
| `.szplt` | Tecplot SZL binary (subzone-loadable) |
| `.plt` / `.bin` | Tecplot PLT binary |
| `.dat` / `.tec` | Tecplot ASCII |

---

## Contributing

Contributions are welcome — see [CONTRIBUTING.md](CONTRIBUTING.md) for details.

---

## References

- [Tecplot data format specification](https://tecplot.azureedge.net/products/360/current/360-data-format.html)
- [TecIO library](https://tecplot.com/products/tecio-library/)
- [Full documentation](https://meersman.github.io/tecio)

---

## Disclaimer

This project is an independent open source library and is not affiliated
with, endorsed by, or supported by Tecplot, Inc. in any way. Tecplot and
TecIO are trademarks of Tecplot, Inc. Use of the TecIO library requires a
separate license from Tecplot, Inc.
