|
1 | 1 | NAME: path |
2 | | -VERSION: 0.1.0 |
3 | | -DESCRIPTION: Pure Python file and directory finder powered by pathlib |
| 2 | +VERSION: "0.1.0" |
| 3 | +DESCRIPTION: > |
| 4 | + Pure Python file and directory finder powered by pathlib. Search for files |
| 5 | + and directories with glob patterns, extension filters, name matching, depth |
| 6 | + control (layers), size filtering, modification date, and tree view output. |
| 7 | + A more intuitive and featureful alternative to find. Stdlib only, no dependencies. |
| 8 | +USAGE: |
| 9 | + - "path [ROOT] [OPTIONS]" |
| 10 | + - "path . -f" |
| 11 | + - "path . -d" |
| 12 | + - "path . -f -p '*.py'" |
| 13 | + - "path . --tree -l 3" |
| 14 | + - "path . -f -L" |
| 15 | + - "path . --count" |
| 16 | +OPTIONS: |
| 17 | + - "-f, --files Find files only" |
| 18 | + - "-d, --dirs Find directories only" |
| 19 | + - "-p, --pattern PATTERN Glob pattern (e.g. '*.py', 'test_*')" |
| 20 | + - "-e, --ext EXT Filter by extension (e.g. py, txt)" |
| 21 | + - "-n, --name NAME Name contains string (case-insensitive)" |
| 22 | + - "-l, --layers N Max depth (0 = root only, default: unlimited)" |
| 23 | + - "-s, --size SIZE Filter by size (+1M = larger, -100K = smaller)" |
| 24 | + - "-m, --modified DAYS Modified within N days" |
| 25 | + - "--hidden Include hidden files and directories" |
| 26 | + - "--count Show count only (files and dirs)" |
| 27 | + - "--abs Show absolute paths" |
| 28 | + - "--tree Tree view output with connectors" |
| 29 | + - "-L, --long Show file sizes alongside names" |
| 30 | + - "-v, --version Show version" |
| 31 | + - "-h, --help Show help" |
| 32 | +EXAMPLES: |
| 33 | + - "path # List everything in current directory" |
| 34 | + - "path . -f # Files only" |
| 35 | + - "path . -d # Directories only" |
| 36 | + - "path . -f -p '*.py' # Python files by glob" |
| 37 | + - "path . -f -e py # Python files by extension" |
| 38 | + - "path . -l 2 # Max 2 layers deep" |
| 39 | + - "path /usr -d -n bin # Dirs containing 'bin' under /usr" |
| 40 | + - "path . -f -s +1M # Files larger than 1MB" |
| 41 | + - "path . -f -s -100K # Files smaller than 100KB" |
| 42 | + - "path . -f -m 7 # Files modified in last 7 days" |
| 43 | + - "path . --tree -l 3 # Tree view, 3 layers" |
| 44 | + - "path . -f -L # List files with sizes" |
| 45 | + - "path . --count # Count files and dirs" |
| 46 | + - "path . -f --abs # Absolute paths" |
| 47 | + - "path . --hidden # Include dotfiles and hidden dirs" |
| 48 | +SIZE_SUFFIXES: |
| 49 | + - "B Bytes" |
| 50 | + - "K Kilobytes (1024)" |
| 51 | + - "M Megabytes (1024^2)" |
| 52 | + - "G Gigabytes (1024^3)" |
| 53 | + - "+SIZE Larger than SIZE" |
| 54 | + - "-SIZE Smaller than SIZE" |
| 55 | +OUTPUT: > |
| 56 | + Default output lists relative paths, one per line. Directories are shown in |
| 57 | + blue with a trailing slash. Tree mode draws connectors with color coding: |
| 58 | + blue for dirs, green for executables, cyan for symlinks. Long mode (-L) shows |
| 59 | + human-readable file sizes. Count mode shows totals only. |
| 60 | + Exit code 0 on success or when no matches found. |
4 | 61 | AUTHOR: "@spacemany2k38" |
| 62 | +DATE: "2026-03-23" |
| 63 | +NOTES: |
| 64 | + - "Root argument defaults to current directory (.) if omitted." |
| 65 | + - "Hidden files/dirs (starting with .) are excluded by default." |
| 66 | + - "Layers control depth: -l 0 shows nothing, -l 1 shows root contents only." |
| 67 | + - "Pattern uses Python's pathlib.Path.match() — supports * and ** globs." |
| 68 | + - "Name filter is case-insensitive substring match." |
| 69 | + - "Size filter prefix: + means larger than, - means smaller than." |
| 70 | + - "Directories are always sorted before files at each level." |
| 71 | + - "PermissionError on directories is silently skipped." |
| 72 | + - "Pure Python — no external dependencies." |
0 commit comments