Metadata-Version: 2.4
Name: dymfile
Version: 0.2.0
Summary: Read and write DYM file format from SEAPODYM project with xarray integration
Project-URL: Homepage, https://github.com/Ash12H/dymfile
Project-URL: Documentation, https://ash12h.github.io/dymfile
Project-URL: Repository, https://github.com/Ash12H/dymfile
Project-URL: Issues, https://github.com/Ash12H/dymfile/issues
Author-email: Ash <lehodey.jules@gmail.com>
License: MIT
Keywords: dym,netcdf,oceanography,seapodym,xarray
Classifier: Development Status :: 3 - Alpha
Classifier: Intended Audience :: Science/Research
Classifier: License :: OSI Approved :: MIT License
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: Topic :: Scientific/Engineering :: Oceanography
Requires-Python: >=3.10
Requires-Dist: numpy>=1.24.0
Requires-Dist: xarray>=2023.1.0
Provides-Extra: dev
Requires-Dist: pre-commit>=3.0.0; extra == 'dev'
Requires-Dist: pyright>=1.1.0; extra == 'dev'
Requires-Dist: pytest-cov>=4.0.0; extra == 'dev'
Requires-Dist: pytest>=7.0.0; extra == 'dev'
Requires-Dist: ruff>=0.8.0; extra == 'dev'
Provides-Extra: docs
Requires-Dist: mkdocs-material>=9.0.0; extra == 'docs'
Requires-Dist: mkdocs>=1.5.0; extra == 'docs'
Requires-Dist: mkdocstrings[python]>=0.24.0; extra == 'docs'
Description-Content-Type: text/markdown

# dymfile

[![Python](https://img.shields.io/badge/python-3.10+-blue.svg)](https://www.python.org/downloads/)
[![License](https://img.shields.io/badge/license-MIT-green.svg)](LICENSE)

**Read and write DYM file format with xarray integration**

DYM is a binary format used by the SEAPODYM project for oceanographic data. This package provides a modern Python interface with native xarray support.

## Features

- ✅ Read DYM files as xarray Datasets
- ✅ Write xarray Datasets to DYM format
- ✅ Native xarray backend: `xr.open_dataset("file.dym", engine="dym")`
- ✅ Command-line tools for format conversion
- ✅ Fully typed with pyright
- ✅ Tested with pytest

## Installation

```bash
git clone https://github.com/Ash12H/dymfile.git
cd dymfile
uv sync
```

Or with pip:

```bash
pip install git+https://github.com/Ash12H/dymfile.git
```

## Quick Start

### Reading

```python
import xarray as xr

# Via xarray backend (recommended)
ds = xr.open_dataset("data.dym", engine="dym")

# Or high-level API
from dymfile import dym_to_dataset
ds = dym_to_dataset("data.dym")
```

### Writing

```python
from dymfile.writer import dataset_to_dym

ds = xr.open_dataset("input.nc")
dataset_to_dym(ds, "output.dym")
```

### CLI Tools

```bash
# Convert DYM to NetCDF
dym-to-dataset input.dym -o output.nc

# Convert NetCDF to DYM
dataset-to-dym input.nc -o output.dym --variable temperature
```

## Documentation

Full documentation available at: [https://ash12h.github.io/dymfile](https://ash12h.github.io/dymfile)

- [Installation Guide](https://ash12h.github.io/dymfile/installation/)
- [Usage Examples](https://ash12h.github.io/dymfile/usage/)
- [Format Specification](https://ash12h.github.io/dymfile/format/)
- [API Reference](https://ash12h.github.io/dymfile/api/)

## Development

### Setup

```bash
# Install with dev dependencies
uv sync --extra dev --extra docs

# Install pre-commit hooks
pre-commit install
```

### Testing

```bash
pytest tests/
```

### Documentation

```bash
mkdocs serve
```

## Project Structure

```
dymfile/
├── src/dymfile/        # Source code
│   ├── reader.py       # Read DYM files
│   ├── writer.py       # Write DYM files
│   ├── backend.py      # Xarray backend
│   ├── cli.py          # Command-line tools
│   ├── _formats.py     # Data structures
│   └── _utils.py       # Utilities
├── tests/              # Test suite
├── docs/               # Documentation
└── data/               # Sample files

```

## Technologies

- **Language**: Python 3.10+
- **Package manager**: uv
- **Linter/Formatter**: ruff
- **Type checker**: pyright
- **Testing**: pytest
- **Documentation**: MkDocs + Material theme

## License

MIT License - see [LICENSE](LICENSE) file

## Acknowledgments

DYM format developed by the SEAPODYM project for oceanographic modeling.
