Registry / data / seedir

seedir

JSON →
library0.5.1pypypi✓ verified 90d ago

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.

pip install seedir
INSTALL
IMPORT
SIG · SEEDIR
S
seedir
datapythonv0.5.1
Install
1.6s avg
Import
221ms
Disk
21MB
Pass rate
10/ 10
Env Coverage10 / 10
glibc
3.9–3.13
musl
3.9–3.13
Install & Compatibility
Where this runs
tested against v0.5.1 · pip install
no network on importno background threads
Install × environment matrix
Each cell = how many times install + import succeeded across repeated harness runs. Partial = flaky.
glibc = Debian/Ubuntu slim · musl = Alpine Linux
musl
py 3.10–3.940 runs
installs and imports cleanly · install 0.0s · import 0.228s · 23MB
glibc
py 3.10–3.940 runs
installs and imports cleanly · install 1.6s · import 0.213s · 23MB
21MB installed
● package 21MB
Code
Verified usage

Verified import paths — ran on the pinned version, not inferred.

seedir
✓ import seedir as sd
seedir.seedir
✓ from seedir.realdir import seedir
✗ from seedir.seedir import seedir
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.
seedir.command_line
✓ N/A (removed)
✗ import seedir.command_line
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`.

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.

import seedir as sd import os # Create a dummy directory structure for demonstration # In a real scenario, you'd point to an existing path. # Create a temporary directory and some files/folders current_dir = os.getcwd() dummy_path = os.path.join(current_dir, 'seedir_example') os.makedirs(os.path.join(dummy_path, 'folder1', 'subfolder_a'), exist_ok=True) os.makedirs(os.path.join(dummy_path, 'folder2'), exist_ok=True) with open(os.path.join(dummy_path, 'file1.txt'), 'w') as f: f.write('content') with open(os.path.join(dummy_path, 'folder1', 'file2.txt'), 'w') as f: f.write('content') # Generate and print the directory tree print(f"\nDirectory tree for '{dummy_path}':") sd.seedir(path=dummy_path, style='lines', depthlimit=3) # Clean up the dummy directory import shutil shutil.rmtree(dummy_path) print("\nCleaned up dummy directory.")
seedir --version
Debug
Known issues
breakingThe `seedir.command_line` module was removed and the command-line interface was revamped.
fix
Instead of importing or calling `seedir.command_line`, use `seedir` directly in the terminal (e.g., `seedir --help`) or `python -m seedir`.
affects: >=0.4.2
breakingThe `emoji` package is no longer a core dependency for all installations.
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.
affects: >=0.4.0
deprecatedThe `slash` parameter for defining folder endings has been deprecated.
fix
Use the `folderend` parameter instead to specify characters at the end of folder lines.
affects: >=0.5.0
gotchaThe `itemlimit` parameter for restricting the number of items now accepts a 2-tuple.
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.
affects: >=0.5.0
gotchaNew parameters were introduced for handling errors during directory listing.
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.
affects: >=0.5.0
gotchaThe `seedir()` function now directly accepts `pathlib.Path` objects.
fix
You can pass `pathlib.Path` objects directly to the `path` argument of `sd.seedir()`, removing the need for explicit string conversions.
affects: >=0.4.0
Errors
Common errors & fixes
ModuleNotFoundError: No module named 'seedir'
The `seedir` package is not installed in the current Python environment.
fix
pip install seedir
FileNotFoundError: [Errno 2] No such file or directory: '/path/to/non/existent/folder'
The specified `path` argument for `seedir.seedir()` does not correspond to an existing file or directory on the system.
fix
Ensure the `path` argument points to a valid and existing directory or file.
ValueError: Invalid style 'invalid_style'. Available styles are: ['emoji', 'lines', 'spaces', 'arrow']
The `style` argument provided to `seedir.seedir()` is not one of the supported style options.
fix
Use a valid style string such as `'lines'`, `'emoji'`, `'spaces'`, or `'arrow'`.
Upgrade
Version history
0.5.1latest on PyPI · released Jun 4, 2025
Audit
Dependencies
natsortrequiredUsed for natural sorting of directory contents.
emojioptionalRequired for using the 'emoji' style in folder tree diagrams.
Agent activity
18 hits · last 30 days
node
16
OpenAI (training)
1
Resources
seedir — pip install seedir · libregistry