Index Module Index Search Page

qnd.lazy module

Lazy file type identification and permission filters.

qnd.lazy.openb(filename, mode='r', auto=1, **kwargs)[source]

Open PDB or HDF5 or netCDF or some othe binary file known to QnD.

This imports the required package as necessary. See qnd.pdbf.openpdb or qnd.h5f.openh5 or some other actual open function for argument details.

qnd.lazy.permfilter(*names)[source]

Given a glob string or list of filenames, exclude unreadable ones.

Parameters:names (str or list of str) – An individual filename or a list of filenames, which may include globbing characters like ‘*’ or ‘?’. Accepts any number of such arguments.
Returns:
  • names (list of str) – The subset of all the specified names for which you have read permission (and which exist). The list may be empty.
  • Globbed results are sorted first by length, then alphabetically,
  • so that, for example, name100 follows name99. Note, however, that
  • name000 also follows name99.