py_tools_ds.io package

Subpackages

Submodules

py_tools_ds.io.pathgen module

py_tools_ds.io.pathgen.get_generic_outpath(dir_out='', fName_out='', prefix='', ext='', create_outDir=True, prevent_overwriting=False)[source]

Generate an output path accourding to the given parameters.

Parameters
  • dir_out – output directory

  • fName_out – output filename

  • prefix – a prefix for the output filename. ignored if fName_out is given

  • ext – the file extension to use

  • create_outDir – whether to automatically create the output directory or not

  • prevent_overwriting – whether to prevent that a output filename is chosen that already exist in the filesystem

Returns

py_tools_ds.io.pathgen.get_tempfile(ext=None, prefix=None, tgt_dir=None)[source]

Return the path to a tempfile.mkstemp() file that can be passed to any function that expects a physical path.

NOTE: The tempfile has to be deleted manually.

Parameters
  • ext – file extension (None if None)

  • prefix – optional file prefix

  • tgt_dir – target directory (automatically set if None)

Module contents