yadg.extractors package
- yadg.extractors.extract(filetype, path)
Worker function of the
extractsubcommand.Extracts data from provided
path, assuming it is the specifiedfiletype. The data is either returned as adatatree.DataTreeor axarray.Dataset, however in either case the returned objects have aret.to_netcdf()as well as aret.to_dict()method, which can be used to write the file.Warning
This feature has been introduced in
yadg-5.0a2and is unstable.- Parameters:
filetype (
str) – Specifies the filetype. Can be bothyadg-native as well as a MaRDA extractorsFileType. Automatically checks for matches using themarda:prefix.path (
Path) – Apathlib.Pathobject pointing to the file to be extracted.
- Returns:
The extracted data and metadata, which can be written to
NetCDFformat usingret.to_netcdf().- Return type:
Union[xr.Dataset, datatree.DataTree]