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.
- ✅ 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
git clone https://github.com/Ash12H/dymfile.git
cd dymfile
uv syncOr with pip:
pip install git+https://github.com/Ash12H/dymfile.gitimport 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")from dymfile.writer import dataset_to_dym
ds = xr.open_dataset("input.nc")
dataset_to_dym(ds, "output.dym")# 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 temperatureFull documentation available at: https://ash12h.github.io/dymfile
# Install with dev dependencies
uv sync --extra dev --extra docs
# Install pre-commit hooks
pre-commit installpytest tests/mkdocs servedymfile/
├── 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
- Language: Python 3.10+
- Package manager: uv
- Linter/Formatter: ruff
- Type checker: pyright
- Testing: pytest
- Documentation: MkDocs + Material theme
MIT License - see LICENSE file
DYM format developed by the SEAPODYM project for oceanographic modeling.