Metadata-Version: 2.4
Name: tob2toa
Version: 0.4.0
Summary: Converts binary Campbell Scientific TOB files to TOA format
License: MIT
Project-URL: Repository, https://github.com/inkenbrandt/tob2toa
Project-URL: Issues, https://github.com/inkenbrandt/tob2toa/issues
Keywords: eddy covariance,micrometeorology,turbulence,spectra,flux
Classifier: Development Status :: 4 - Beta
Classifier: Intended Audience :: Science/Research
Classifier: Topic :: Scientific/Engineering :: Atmospheric Science
Classifier: Programming Language :: Python :: 3
Classifier: Programming Language :: Python :: 3.10
Classifier: Programming Language :: Python :: 3.11
Classifier: Programming Language :: Python :: 3.12
Requires-Python: >=3.10
Description-Content-Type: text/markdown
License-File: LICENSE
Requires-Dist: numpy>=1.24
Requires-Dist: scipy>=1.10
Requires-Dist: polars>=0.19
Requires-Dist: pandas>=1.5
Requires-Dist: pyarrow
Requires-Dist: KDEpy>=1.1
Requires-Dist: matplotlib>=3.7
Provides-Extra: duckdb
Requires-Dist: duckdb>=0.9; extra == "duckdb"
Provides-Extra: dev
Requires-Dist: pytest>=7.4; extra == "dev"
Requires-Dist: pytest-cov>=4.1; extra == "dev"
Requires-Dist: black>=24.3; extra == "dev"
Requires-Dist: jupyter>=1.0; extra == "dev"
Requires-Dist: ipykernel>=6.27; extra == "dev"
Provides-Extra: docs
Requires-Dist: mkdocs>=1.5; extra == "docs"
Requires-Dist: mkdocs-material>=9.0; extra == "docs"
Requires-Dist: mkdocstrings[python]>=0.24; extra == "docs"
Dynamic: license-file

# tob2toa

A Python utility to convert Campbell Scientific TOB3 binary data files to TOA5 ASCII format.

This tool aims to replicate the functionality of Campbell Scientific's CardConvert utility, allowing for easy conversion of binary data files on non-Windows systems or as part of automated data processing pipelines.

## Features

- Supports TOB3 binary format.
- Automatically handles various Campbell Scientific data types:
  - IEEE4, IEEE4B, FP4, IEEE8, IEEE8B
  - INT2, UINT2, INT4, UINT4
  - BOOL, BOOL1, BOOL2, BOOL4
  - ASCII(N)
- Correctly handles timestamps and record numbers.
- Supports batch conversion of multiple files.
- Command-line interface and Python API.

## Installation

You can install `tob2toa` from source:

```bash
git clone https://github.com/paultgriffiths/tob2toa.git
cd tob2toa
pip install .
```

For development:

```bash
pip install -e ".[dev]"
```

## Usage

### Command Line

Convert a single file:

```bash
python -m tob2toa.tob2toa input_file.dat
```

Convert a single file with a specific output name:

```bash
python -m tob2toa.tob2toa input_file.dat output_file.dat
```

Batch convert all `.dat` files in a directory:

```bash
python -m tob2toa.tob2toa *.dat
```

### Python API

```python
from tob2toa.tob2toa import convert_tob3_to_toa5

# Convert a file
output_path = convert_tob3_to_toa5("path/to/input.dat")
print(f"Converted file saved to: {output_path}")
```

## License

This project is licensed under the MIT License - see the [LICENSE](LICENSE) file for details.
