{"id":22444,"library":"tempdir","title":"tempdir","description":"A simple library providing temporary directory contexts, wrapping tempfile.mkdtemp. Current version 0.7.1, low activity.","status":"maintenance","version":"0.7.1","language":"python","source_language":"en","source_url":"https://github.com/chrissimpkins/tempdir","tags":["temporary-directory","tempfile","context-manager"],"install":[{"cmd":"pip install tempdir","lang":"bash","label":"pip"}],"dependencies":[],"imports":[{"note":"correct import","symbol":"TempDir","correct":"from tempdir import TempDir"}],"quickstart":{"code":"import os\nfrom tempdir import TempDir\nwith TempDir() as td:\n    td.write('test.txt', 'hello')\n    assert os.path.isdir(td.name)\nassert not os.path.exists(td.name)","lang":"python","description":"Create and automatically clean up a temporary directory using TempDir context manager."},"warnings":[{"fix":"Use the returned TempDir object's .name attribute for the path.","message":"TempDir creates a new directory each time; the directory is not reused. Do not rely on the path being predictable.","severity":"gotcha","affected_versions":"all"},{"fix":"Set umask or adjust permissions manually after creation if security is a concern.","message":"TempDir does not set permissions; directory permissions are inherited from umask. Might be world-readable if umask is permissive.","severity":"gotcha","affected_versions":"all"},{"fix":"Replace with: from tempfile import TemporaryDirectory","message":"The library is no longer actively maintained. Consider using tempfile.TemporaryDirectory from the standard library instead.","severity":"deprecated","affected_versions":">=0.7.0"}],"env_vars":null,"last_verified":"2026-04-27T00:00:00.000Z","next_check":"2026-07-26T00:00:00.000Z","problems":[{"fix":"pip install tempdir","cause":"tempdir not installed or environment issue","error":"ModuleNotFoundError: No module named 'tempdir'"},{"fix":"Use: from tempdir import TempDir","cause":"Wrong import: import tempdir then using tempdir.TempDir","error":"AttributeError: module 'tempdir' has no attribute 'TempDir'"},{"fix":"Use: from tempfile import TemporaryDirectory","cause":"tempdir library not standard library; standard library's tempfile has TemporaryDirectory","error":"tempdir.TempDir is deprecated"}],"ecosystem":"pypi","meta_description":null,"install_score":null,"install_tag":null,"quickstart_score":null,"quickstart_tag":null}