{"id":6876,"library":"seedir","title":"seedir","description":"seedir is a Python package designed for creating, editing, and displaying folder tree diagrams. It provides a straightforward way to visualize directory structures, supporting both real file systems and 'fake' directory objects for testing or presentation. The library is actively maintained, with its current version being 0.5.1, and receives regular updates.","status":"active","version":"0.5.1","language":"en","source_language":"en","source_url":"https://github.com/earnestt1234/seedir","tags":["directory tree","file system","visualization","diagrams","folder structure"],"install":[{"cmd":"pip install seedir","lang":"bash","label":"Basic Installation"},{"cmd":"pip install seedir[emoji]","lang":"bash","label":"Installation with Emoji Support"}],"dependencies":[{"reason":"Used for natural sorting of directory contents.","package":"natsort","optional":false},{"reason":"Required for using the 'emoji' style in folder tree diagrams.","package":"emoji","optional":true}],"imports":[{"symbol":"seedir","correct":"import seedir as sd"},{"note":"The internal module `seedir.seedir` was renamed to `seedir.realdir` in an earlier version. While `sd.seedir()` (after `import seedir as sd`) still works, direct imports from `seedir.seedir` will fail.","wrong":"from seedir.seedir import seedir","symbol":"seedir.seedir","correct":"from seedir.realdir import seedir"},{"note":"The `seedir.command_line` module and its functionality were removed in version 0.4.2. Command-line execution is now handled via `seedir` directly or `python -m seedir`.","wrong":"import seedir.command_line","symbol":"seedir.command_line","correct":"N/A (removed)"}],"quickstart":{"code":"import seedir as sd\nimport os\n\n# Create a dummy directory structure for demonstration\n# In a real scenario, you'd point to an existing path.\n\n# Create a temporary directory and some files/folders\ncurrent_dir = os.getcwd()\ndummy_path = os.path.join(current_dir, 'seedir_example')\nos.makedirs(os.path.join(dummy_path, 'folder1', 'subfolder_a'), exist_ok=True)\nos.makedirs(os.path.join(dummy_path, 'folder2'), exist_ok=True)\nwith open(os.path.join(dummy_path, 'file1.txt'), 'w') as f: f.write('content')\nwith open(os.path.join(dummy_path, 'folder1', 'file2.txt'), 'w') as f: f.write('content')\n\n# Generate and print the directory tree\nprint(f\"\\nDirectory tree for '{dummy_path}':\")\nsd.seedir(path=dummy_path, style='lines', depthlimit=3)\n\n# Clean up the dummy directory\nimport shutil\nshutil.rmtree(dummy_path)\nprint(\"\\nCleaned up dummy directory.\")","lang":"python","description":"This quickstart demonstrates how to use `seedir.seedir()` to print a directory tree. It first creates a temporary directory structure and then visualizes it using the 'lines' style, limiting the depth for conciseness. Finally, it cleans up the created dummy directory."},"warnings":[{"fix":"Instead of importing or calling `seedir.command_line`, use `seedir` directly in the terminal (e.g., `seedir --help`) or `python -m seedir`.","message":"The `seedir.command_line` module was removed and the command-line interface was revamped.","severity":"breaking","affected_versions":">=0.4.2"},{"fix":"If you use the 'emoji' style or other emoji-dependent features, you must install `seedir` with the `[emoji]` extra: `pip install seedir[emoji]`. Otherwise, an error will be raised when attempting to use an emoji style.","message":"The `emoji` package is no longer a core dependency for all installations.","severity":"breaking","affected_versions":">=0.4.0"},{"fix":"Use the `folderend` parameter instead to specify characters at the end of folder lines.","message":"The `slash` parameter for defining folder endings has been deprecated.","severity":"deprecated","affected_versions":">=0.5.0"},{"fix":"To specify separate limits for folders and files, pass a 2-tuple `(folder_limit, file_limit)` to `itemlimit`. For example, `itemlimit=(5, 10)` will show up to 5 folders and 10 files per directory.","message":"The `itemlimit` parameter for restricting the number of items now accepts a 2-tuple.","severity":"gotcha","affected_versions":">=0.5.0"},{"fix":"If you encounter permissions errors or other `OSError` types when `seedir` tries to list directory contents, you can now use `acceptable_listdir_errors` (e.g., `[PermissionError]`) to ignore them and `denied_string` to mark those entries.","message":"New parameters were introduced for handling errors during directory listing.","severity":"gotcha","affected_versions":">=0.5.0"},{"fix":"You can pass `pathlib.Path` objects directly to the `path` argument of `sd.seedir()`, removing the need for explicit string conversions.","message":"The `seedir()` function now directly accepts `pathlib.Path` objects.","severity":"gotcha","affected_versions":">=0.4.0"}],"env_vars":null,"last_verified":"2026-04-15T00:00:00.000Z","next_check":"2026-07-14T00:00:00.000Z","problems":[]}