Skip to content

engeir/ncdump-rich

Repository files navigation

Rich NcDump

PyPI PyPI Downloads Status Python Version License Read the documentation at https://ncdump-rich.readthedocs.io/ Tests Codecov pre-commit Black Ruff

Features

This project provides an easy way of previewing netCDF files with nicely formatted text in your terminal. The information extracted from the .nc files are obtained in a similar way to this example, with some modifications. The source code used on the website can be downloaded as netcdf_example.py with:

$ curl -O http://schubert.atmos.colostate.edu/~cslocum/code/netcdf_example.py

To make the output more readable it is formatted using the python library rich.

Requirements

The project depends on the python packages click, netCDF4 and rich. Installation via pip or pipx ensures that all dependencies are installed correctly.

Installation

You can install Rich NcDump via pip from PyPI:

$ pip install ncdump-rich

or perhaps even better via pipx:

$ pipx install ncdump-rich

Usage

Please see the Command-line Reference for details.

image

Examples

Use the program as a previewer for .nc files, for example through stpv. My own fork provides additional support for previewing .nc files using this project.

Preview in lf

image

Similarly you can get preview of .nc files in nnn by including an option for the extension nc in the preview-tui plugin_.

nc) fifo_pager ncdump-rich "$1" ;;

Preview in nnn

image

Contributing

Contributions are very welcome. To learn more, see the Contributor Guide.

License

Distributed under the terms of the GPL 3.0 license, Rich NcDump is free and open source software.

Issues

If you encounter any problems, please file an issue along with a detailed description.

Credits

This project was generated from @cjolowicz's Hypermodern Python Cookiecutter template.