Skip to content

Read file-like object datasets #937

@davidhassell

Description

@davidhassell

It would be very nice to be able to read datasets defined by an open file handle with cfdm.read.

>>> import fsspec
>>> fs = fsspec.filesystem(...)
>>> fh = fs.open('filename.nc', 'rb')
>>> f = cf.read(fh)

This particular example would be equivalent to:

>>> f = cf.read('filename.nc', filesystem=fs)

E.g. for a local file, this should also work:

>>> fh = open('filename.nc', 'rb')
>>> f = cf.read(fh)

This will be largely implemented via NCAS-CMS/cfdm#401

PR to follow.

Metadata

Metadata

Assignees

No one assigned

    Labels

    dataset readRelating to reading datasetsenhancementNew feature or request

    Type

    No type
    No fields configured for issues without a type.

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions