Metadata-Version: 2.4
Name: oafuncs
Version: 0.0.99.38
Summary: Oceanic and Atmospheric Functions
Home-page: https://github.com/OAKun/OAFuncs
Author: Kun Liu
Author-email: liukun0312@stu.ouc.edu.cn
License: MIT
Classifier: Programming Language :: Python
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: Programming Language :: Python :: Implementation :: CPython
Classifier: Programming Language :: Python :: Implementation :: PyPy
Requires-Python: >=3.10.0
Description-Content-Type: text/markdown
License-File: LICENSE.txt
Requires-Dist: rich
Provides-Extra: data
Requires-Dist: numpy; extra == "data"
Requires-Dist: scipy; extra == "data"
Requires-Dist: pandas; extra == "data"
Requires-Dist: xarray; extra == "data"
Provides-Extra: nc
Requires-Dist: numpy; extra == "nc"
Requires-Dist: xarray; extra == "nc"
Requires-Dist: dask; extra == "nc"
Requires-Dist: netCDF4; extra == "nc"
Provides-Extra: draw
Requires-Dist: numpy; extra == "draw"
Requires-Dist: matplotlib; extra == "draw"
Requires-Dist: cartopy; extra == "draw"
Requires-Dist: opencv-python; extra == "draw"
Provides-Extra: geo
Requires-Dist: numpy; extra == "geo"
Requires-Dist: xarray; extra == "geo"
Requires-Dist: geopandas; extra == "geo"
Requires-Dist: rasterio; extra == "geo"
Requires-Dist: salem; extra == "geo"
Provides-Extra: down
Requires-Dist: numpy; extra == "down"
Requires-Dist: beautifulsoup4; extra == "down"
Requires-Dist: httpx; extra == "down"
Requires-Dist: lxml; extra == "down"
Requires-Dist: pandas; extra == "down"
Requires-Dist: requests; extra == "down"
Requires-Dist: xarray; extra == "down"
Requires-Dist: netCDF4; extra == "down"
Requires-Dist: matplotlib; extra == "down"
Provides-Extra: office
Requires-Dist: xlrd; extra == "office"
Requires-Dist: python-docx; extra == "office"
Requires-Dist: python-pptx; extra == "office"
Provides-Extra: parallel
Requires-Dist: psutil; extra == "parallel"
Requires-Dist: dask; extra == "parallel"
Provides-Extra: all
Requires-Dist: beautifulsoup4; extra == "all"
Requires-Dist: cartopy; extra == "all"
Requires-Dist: dask; extra == "all"
Requires-Dist: geopandas; extra == "all"
Requires-Dist: httpx; extra == "all"
Requires-Dist: lxml; extra == "all"
Requires-Dist: matplotlib; extra == "all"
Requires-Dist: netCDF4; extra == "all"
Requires-Dist: numpy; extra == "all"
Requires-Dist: opencv-python; extra == "all"
Requires-Dist: pandas; extra == "all"
Requires-Dist: psutil; extra == "all"
Requires-Dist: python-docx; extra == "all"
Requires-Dist: python-pptx; extra == "all"
Requires-Dist: rasterio; extra == "all"
Requires-Dist: requests; extra == "all"
Requires-Dist: salem; extra == "all"
Requires-Dist: scipy; extra == "all"
Requires-Dist: xarray; extra == "all"
Requires-Dist: xlrd; extra == "all"
Provides-Extra: full
Requires-Dist: beautifulsoup4; extra == "full"
Requires-Dist: cartopy; extra == "full"
Requires-Dist: dask; extra == "full"
Requires-Dist: geopandas; extra == "full"
Requires-Dist: httpx; extra == "full"
Requires-Dist: lxml; extra == "full"
Requires-Dist: matplotlib; extra == "full"
Requires-Dist: netCDF4; extra == "full"
Requires-Dist: numpy; extra == "full"
Requires-Dist: opencv-python; extra == "full"
Requires-Dist: pandas; extra == "full"
Requires-Dist: psutil; extra == "full"
Requires-Dist: python-docx; extra == "full"
Requires-Dist: python-pptx; extra == "full"
Requires-Dist: rasterio; extra == "full"
Requires-Dist: requests; extra == "full"
Requires-Dist: salem; extra == "full"
Requires-Dist: scipy; extra == "full"
Requires-Dist: xarray; extra == "full"
Requires-Dist: xlrd; extra == "full"
Provides-Extra: science
Requires-Dist: cartopy; extra == "science"
Requires-Dist: dask; extra == "science"
Requires-Dist: geopandas; extra == "science"
Requires-Dist: matplotlib; extra == "science"
Requires-Dist: netCDF4; extra == "science"
Requires-Dist: numpy; extra == "science"
Requires-Dist: opencv-python; extra == "science"
Requires-Dist: pandas; extra == "science"
Requires-Dist: rasterio; extra == "science"
Requires-Dist: salem; extra == "science"
Requires-Dist: scipy; extra == "science"
Requires-Dist: xarray; extra == "science"
Dynamic: author
Dynamic: author-email
Dynamic: classifier
Dynamic: description
Dynamic: description-content-type
Dynamic: home-page
Dynamic: license
Dynamic: license-file
Dynamic: provides-extra
Dynamic: requires-dist
Dynamic: requires-python
Dynamic: summary


# oafuncs

Oceanic and Atmospheric Functions: a small Python utility package for daily
geoscience workflows, including NetCDF handling, interpolation, plotting,
geographic masks, downloads, file operations, and model-related helpers.

The package is designed for practical research scripts. It prefers direct,
readable functions over heavy framework-style abstractions.

## Links

- PyPI: <https://pypi.org/project/oafuncs>
- GitHub: <https://github.com/OAKun/OAFuncs>
- Download stats: <https://pypistats.org/packages/oafuncs>
- Wiki: <https://deepwiki.com/OAKun/OAFuncs>

## Installation

Base install:

```bash
pip install oafuncs
```

Install optional dependencies by workflow:

```bash
pip install "oafuncs[nc]"
pip install "oafuncs[draw]"
pip install "oafuncs[science]"
```

Available extras include:

```text
data, nc, draw, geo, down, office, parallel, science, full
```

## Usage

Import the package and access submodules directly:

```python
import oafuncs

is_valid = oafuncs.oa_nc.check(r"D:\Data\sample.nc")
files = oafuncs.oa_file.find_file(r"D:\Data", "*.nc", deep_find=True)
```

NetCDF compression:

```python
import oafuncs

oafuncs.oa_nc.compress(
    r"D:\Data\input.nc",
    r"D:\Data\input_mini.nc",
)
```

Interpolation:

```python
import numpy as np
import oafuncs

result = oafuncs.oa_data.interp_along_dim(
    target_coordinates=np.array([0.5, 1.5]),
    source_coordinates=np.array([0.0, 1.0, 2.0]),
    source_data=np.array([[0.0, 10.0, 20.0], [1.0, 11.0, 21.0]]),
    interpolation_axis=1,
)
```

Progress bar:

```python
import oafuncs

for item in oafuncs.oa_tool.pbar(range(100), description="Processing"):
    ...
```

## Modules

| Module | Purpose |
| --- | --- |
| `oa_nc` | NetCDF read/write helpers, merge, subset, drawing, compression |
| `oa_data` | 1D/2D interpolation and small data helpers |
| `oa_geo` | Distance calculation, shapefile masks, land/ocean masks |
| `oa_draw` | Common plotting helpers, map setup, GIF/video generation |
| `oa_cmap` | Custom colormaps and color utilities |
| `oa_file` | File search, copy, move, rename, remove, and text replacement |
| `oa_date` | Date ranges, time adjustment, timing decorator |
| `oa_down` | HYCOM and literature download helpers |
| `oa_model` | Model-specific helpers, including ROMS and WRF utilities |
| `oa_linux` | Linux/HPC and Slurm helpers |
| `oa_office` | Office document helpers |
| `oa_sign` | Personal website sign-in helpers |
| `oa_tool` | Progress bar, email, and parallel executor helpers |

## Notes

- The base install is intentionally light. Install extras for plotting,
  NetCDF, downloading, or geospatial workflows.
- Some modules depend on optional scientific packages such as `xarray`,
  `netCDF4`, `cartopy`, `geopandas`, or `scipy`.
- NetCDF compression uses `scale_factor`/`add_offset`; check precision and
  missing-value behavior when using it for scientific datasets.

## License

MIT License. See [LICENSE.txt](LICENSE.txt).
