Skip to content

[FEATURE]: Support reading/writing NetCDF4 from/to buffer (and .nc.gz) #6181

@tovogt

Description

@tovogt

Is your feature request related to a problem?

There is this veeeeery old PR from 2016 about adding gzip support to NetCDF4 when used with OpenDAP: #817 The last comment, from 2018, claimed that "netCDF4-Python does not support Python file objects". However, this limitation has been solved a long time ago in 2017 in NetCDF4 (Unidata/netcdf4-python#652).

Describe the solution you'd like

It would be great if xr.Dataset.to_netcdf as well as xr.open_dataset could add support for file-like objects when used with engine="netcdf4". Once this is done, it should be easy to also support .nc.gz files in case of the NETCDF4 format (which is currently only supported in case of NETCDF3).

Describe alternatives you've considered

No response

Additional context

No response

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions