file.tempΒΆ

file.temp.dir(**kwargs):

Create a temporary directory

Returns:

tempfile.TemporaryDirectory() object

Return type:

object

file.temp.file(**kwargs):

Returns an object for a tempfile Currently only the name attribute is populated

Keyword Arguments:
  • name (str) – The filename that should be used. Will generate one of none given

  • dir (object,str) – The temp-dir that should be used to store the file. Can be an existing path (string) or a temp_dir() object

Returns:

A tmpfile object. Use the name attribute to get the filename

Return type:

object

file.temp.name(temp_obj):

Gets the name (== the path) of the temp-directory Returns False if there is not temp_dir

Parameters:

temp_obj (object) – The temp object (created by temp_dir) from which the name should be extracted

Returns:

Name of the temp_dir (== the path), False if temp_obj was not a valid object or had no name attribute

Return type:

string, bool