If you need to name the temporary files AND directories it looks like you'll have to manage the names and/or creation/deletion yourself.
However, if you just need to control the names of the files you can use tempfile.TemporaryDirectory()
to create a temp directory, created your named files in that directory, and then it will all get deleted when it goes out of context.
Like this:
with tempfile.TemporaryDirectory() as temp_dir:
# open your files here
named_file = open(os.path.join(temp_dir, "myname.txt"), 'w')
# do what you want with file...
# directory and files get automatically deleted here...
Additional example:
>>> import tempfile
>>> t = tempfile.TemporaryDirectory()
>>> print(t)
<TemporaryDirectory '/tmp/tmpqign52ry'>
>>> print(t.name)
/tmp/tmpqign52ry