Skip to main content

Curses Tree Style Path Picker

Project description


A Curses based, tree style, path picker. For use as a terminal based file dialog.


  • Pre-order file system traversal from a given point, or $PWD if not specified.
  • Support both Vi & Emacs bindings and jumping to next or previous parent.
  • Expand or collapse child nodes one at a time or all at once.
  • Recursively get disk usage of a single node or all expanded nodes.
  • Toggle display of dotfiles.
  • Toggle marking of files that can then be piped into another program or simply echoed back to the screen upon exit.
  • Reset marking and expansion.


pip install treepick


USAGE: treepick [-h] [-a] [path]

Select paths from a directory tree.

path          A valid path.

-h, --help    Show this help message and exit.
-a, --hidden  Show all hidden paths too.


from treepick import pick

hidden = True

parent_path = '/path/to/directory'

my_list_of_paths = pick(parent_path, hidden)



UP, k, p Step up one line.
DOWN, j, n Step down one line.
K, P Jump to previous parent directory.
J, N Jump to next parent directory.
PGDN, d, v Jump down a page of lines.
PGUP, u, V Jump up a page of lines.
g, < Jump to first line.
G, > Jump to last line.
RIGHT, l, f Expand and step into directory.
TAB, RET Toggle expansion/collapse of directory.
LEFT, h, b Collapse directory.
SHIFT RIGHT, L, F Expand directory and child directories.
SHIFT LEFT, H, B Jump to parent directory and collapse all.
m, SPC Toggle marking of paths.
M Toggle marking of all currently expanded paths.
. Toggle display of dotfiles.
s Display total size of path, recursively
S Display totol size of all currently expanded paths.
r Reset marking and expansion.
q, ESC Quit and display all marked paths.


  • <input type="checkbox" checked="" disabled="" /> Support window resizing.
  • <input type="checkbox" disabled="" /> Different colors for sizes and marks.
  • <input type="checkbox" checked="" disabled="" /> Fix permission exception handling in my du package.
  • <input type="checkbox" checked="" disabled="" /> Retain traversal position when toggling hidden directories.

Project details

Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Files for treepick, version 0.1.2
Filename, size File type Python version Upload date Hashes
Filename, size treepick-0.1.2-py3-none-any.whl (9.2 kB) File type Wheel Python version py3 Upload date Hashes View
Filename, size treepick-0.1.2.tar.gz (8.5 kB) File type Source Python version None Upload date Hashes View

Supported by

AWS AWS Cloud computing Datadog Datadog Monitoring DigiCert DigiCert EV certificate Facebook / Instagram Facebook / Instagram PSF Sponsor Fastly Fastly CDN Google Google Object Storage and Download Analytics Microsoft Microsoft PSF Sponsor Pingdom Pingdom Monitoring Salesforce Salesforce PSF Sponsor Sentry Sentry Error logging StatusPage StatusPage Status page