Skip to main content

No project description provided

Project description

inspectds

GitHub release (latest by date) CI

A CLI utility to print metadata of datasets in various formats (e.g. NetCDF, zarr, GRIB, tiff etc)

powered by xarray

Prerequisites

You need the following binary dependencies:

  • Python >= 3.9
  • Optionally, eccodes, which is necessary for GRIB support.

Installation

conda

conda install -c conda-forge inspectds

PyPI

The recommended way of installation is pipx:

pipx install inspectds

or if you want support for GRIB, SELAFIN or both:

pipx install 'inspectds[grib]'
pipx install 'inspectds[selafin]'
pipx install 'inspectds[all]'

If you want to install the latest development version from git, then use:

pipx install 'git+https://github.com/pmav99/inspectds.git#egg=inspectds[all]'

Note: Support for GRIB also requires eccodes. This is not a python dependency! You need to install it via e.g. apt or conda or compile it from source or whatever.

Usage

Netcdf

$ inspectds tests/data/example_1.nc

Dimensions: (lat: 5, level: 4, lon: 10, time: 1)
Coordinates:
  * lat      (lat) int32 20 30 40 50 60
  * lon      (lon) int32 -160 -140 -118 -96 -84 -52 -45 -35 -25 -15
  * level    (level) int32 1000 850 700 500
  * time     (time) datetime64[ns] 1996-01-01T12:00:00
Data variables:
    temp     (time, level, lat, lon) float32 ...
    rh       (time, lat, lon) float32 ...

Zarr

$ inspectds tests/data/store.zarr

Dimensions: (lat: 19, lon: 36, time: 12)
Coordinates:
  * lat      (lat) int64 -90 -80 -70 -60 -50 -40 -30 ... 30 40 50 60 70 80 90
  * lon      (lon) int64 -180 -170 -160 -150 -140 -130 ... 130 140 150 160 170
  * time     (time) datetime64[ns] 2001-01-31 2001-02-28 ... 2001-12-31
Data variables:
    aaa      (lon, lat, time) int64 ...

Tiff

$ inspectds ETOPO_2022_v1_60s_N90W180_surface.tif
Dimensions: (band: 1, x: 21600, y: 10800)
Coordinates:
  * band         (band) int64 8B 1
  * x            (x) float64 173kB -180.0 -180.0 -180.0 ... 180.0 180.0 180.0
  * y            (y) float64 86kB 89.99 89.97 89.96 ... -89.96 -89.98 -89.99
    spatial_ref  int64 8B 0
Data variables:
    band_data  (band, y, x) float32 933MB ...

GRIB

$ inspectds tests/data/example.grib

Dimensions: (number: 2, time: 3, isobaricInhPa: 2, latitude: 3, longitude: 4)
Coordinates:
  * number         (number) int64 0 1
  * time           (time) datetime64[ns] 2017-01-01 ... 2017-01-02
    step           timedelta64[ns] ...
  * isobaricInhPa  (isobaricInhPa) float64 850.0 500.0
  * latitude       (latitude) float64 90.0 0.0 -90.0
  * longitude      (longitude) float64 0.0 90.0 180.0 270.0
    valid_time     (time) datetime64[ns] ...
Data variables:
    z        (number, time, isobaricInhPa, latitude, longitude) float32 ...
    t        (number, time, isobaricInhPa, latitude, longitude) float32 ...

SELAFIN

$ inspectds tests/data/iceland.slf
Dimensions: (time: 13, node: 3526)
Coordinates:
    x        (node) float32 14kB -13.99 -14.97 -15.89 ... -13.52 -16.31 -12.28
    y        (node) float32 14kB 57.38 60.19 69.79 63.11 ... 66.37 69.34 63.52
  * time     (time) datetime64[ns] 104B 2017-10-01 ... 2017-10-01T12:00:00
Data variables:
    S        (time, node) float32 183kB ...

More info:

$ inspectds --help

 Usage: inspectds [OPTIONS] PATH

╭─ Arguments ─────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────╮
│ *    path      PATH  The path to the dataset [default: None] [required]                                                                                                                                                                                     │
╰─────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────╯
╭─ Options ───────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────╮
│ --dataset-type                                       [auto|netcdf|zarr|grib|selafin]  The dataset type. If 'auto', then it gets inferred from PATH [default: auto]                                                                                          │
│ --mask-and-scale         --no-mask-and-scale                                          Whether to mask and scale the dataset [default: no-mask-and-scale]                                                                                                    │
│ --dimensions             --no-dimensions                                              Whether to include 'Dimensions' in the output [default: dimensions]                                                                                                   │
│ --coordinates            --no-coordinates                                             Whether to include 'Coordinates' in the output [default: coordinates]                                                                                                 │
│ --variables              --no-variables                                               Whether to include 'Variables' in the output [default: variables]                                                                                                     │
│ --variable-attributes    --no-variable-attributes                                     Whether to include the variable attributes in the output [default: no-variable-attributes]                                                                            │
│ --global-attributes      --no-global-attributes                                       Whether to include the global attributes in the output [default: no-global-attributes]                                                                                │
│ --full                   --no-full                                                    Display full output. Overrides any other option [default: no-full]                                                                                                    │
│ --version                                                                             Display the version                                                                                                                                                   │
│ --help                                                                                Show this message and exit.                                                                                                                                           │
╰─────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────╯

Development

mamba env create --file ci/py3.11.yml --name inspectds_dev
conda activate inspectds_dev
make init
make test

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

inspectds-0.5.0.tar.gz (7.0 kB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

inspectds-0.5.0-py3-none-any.whl (7.6 kB view details)

Uploaded Python 3

File details

Details for the file inspectds-0.5.0.tar.gz.

File metadata

  • Download URL: inspectds-0.5.0.tar.gz
  • Upload date:
  • Size: 7.0 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: poetry/2.3.1 CPython/3.14.4 Linux/7.0.5-arch1-1

File hashes

Hashes for inspectds-0.5.0.tar.gz
Algorithm Hash digest
SHA256 a17f07fa1ea8c99de342282275bae30d8680315f1631f4d7c1d19b7a5a9b6123
MD5 cf7504f7d404966a545baf303f2c0169
BLAKE2b-256 4eb85e5f971c53f82a6c810c790d68abe2948513777b21220cadfd8ad606ec37

See more details on using hashes here.

File details

Details for the file inspectds-0.5.0-py3-none-any.whl.

File metadata

  • Download URL: inspectds-0.5.0-py3-none-any.whl
  • Upload date:
  • Size: 7.6 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: poetry/2.3.1 CPython/3.14.4 Linux/7.0.5-arch1-1

File hashes

Hashes for inspectds-0.5.0-py3-none-any.whl
Algorithm Hash digest
SHA256 1a4c192677d99e5bec32245fa4e50fef35dde3a4261a22c44cf9fd252a662a3f
MD5 ed42229cb0e52f39915ce0921206a5fc
BLAKE2b-256 c0bd4384075dd7c18a310208eea26140a48b4c3732391560d02fcd173c294119

See more details on using hashes here.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Pingdom Monitoring Sentry Error logging StatusPage Status page