exatomic.exa.util.io module

Disk I/O Utilities

exatomic.exa.util.io.read_tarball(path, shortkey=False, classes=<class 'exatomic.exa.core.editor.Editor'>)[source]

Read a (possibly compressed) tarball archive and return a dictionary of editors.

eds = read_tarball(path, classes=MyEditor)    # All files read as type MyEditor
# Only read the special file as type MyEditor (default to Editor)
eds = read_tarball(path.bz2, classes={'specialfile': MyEditor})
eds = read_tarball(path, classes=myfunc)      # Complex function that returns classes
Parameters:
  • path (str) – Path to tarball archive

  • keypath (bool) – Full member path as key (true, default); file name as key (false)

  • classes – Class, dictionary of classes, or callable to return class