Skip to content

Introduction

This library brings a simple set of filesystem-oriented dialogs to Textual applications. If you have a need to give your users a dialog that lets them pick a file for opening, a file for saving, or they need to pick a directory, this might be the library for you.

Examples

Opening a file

OpenAFileApp ┌─ Open ───────────────────────────────────────────────────────┐ │/Users/davep/develop/python/textual-fspicker│ │──────────────────────────────────────────────────────────────│ ││ │📁 ..                          928 2026-05-07 11:45:23│ │📁 dist                        160 2026-05-20 16:56:33│ │📁 docs                        128 2025-03-04 08:58:55│ │📁 src                          96 2025-01-13 14:18:20│ │📄 CONTRIBUTING.md            1787 2025-08-11 09:33:56│ │📄 ChangeLog.md               6075 2026-05-20 16:53:00▅▅│ │📄 LICENSE                    1087 2025-01-13 09:23:43│ │📄 Makefile                   3920 2026-02-04 16:42:37│ ││ ││ │▊▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▎▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔│ │▊▎ Open  Cancel │ │▊▁▁▁▁▁▁▁▁▁▁▁▁▁▁▁▁▁▁▁▁▁▁▁▁▁▎▁▁▁▁▁▁▁▁▁▁▁▁▁▁▁▁▁▁▁▁▁▁▁▁▁▁▁▁▁▁▁▁│ ││ └──────────────────────────────────────────────────────────────┘

from textual import work
from textual.app import App

from textual_fspicker import FileOpen


class OpenAFileApp(App[None]):
    @work
    async def on_mount(self) -> None:
        await self.push_screen_wait(FileOpen())


if __name__ == "__main__":
    OpenAFileApp().run()

Saving a file

SaveAFileApp ┌─ Save as ────────────────────────────────────────────────────┐ │/Users/davep/develop/python/textual-fspicker│ │──────────────────────────────────────────────────────────────│ ││ │📁 ..                          928 2026-05-07 11:45:23│ │📁 dist                        160 2026-05-20 16:56:33│ │📁 docs                        128 2025-03-04 08:58:55│ │📁 src                          96 2025-01-13 14:18:20│ │📄 CONTRIBUTING.md            1787 2025-08-11 09:33:56│ │📄 ChangeLog.md               6075 2026-05-20 16:53:00▅▅│ │📄 LICENSE                    1087 2025-01-13 09:23:43│ │📄 Makefile                   3920 2026-02-04 16:42:37│ ││ ││ │▊▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▎▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔│ │▊▎ Save  Cancel │ │▊▁▁▁▁▁▁▁▁▁▁▁▁▁▁▁▁▁▁▁▁▁▁▁▁▁▎▁▁▁▁▁▁▁▁▁▁▁▁▁▁▁▁▁▁▁▁▁▁▁▁▁▁▁▁▁▁▁▁│ ││ └──────────────────────────────────────────────────────────────┘

from textual import work
from textual.app import App

from textual_fspicker import FileSave


class SaveAFileApp(App[None]):
    @work
    async def on_mount(self) -> None:
        await self.push_screen_wait(FileSave())


if __name__ == "__main__":
    SaveAFileApp().run()

Selecting a directory

SelectADirectoryApp ┌─ Select directory ───────────────────────────────────────────┐ ││ │📁 ..                            928 2026-05-07 11:45:23│ │📁 dist                          160 2026-05-20 16:56:33│ │📁 docs                          128 2025-03-04 08:58:55│ │📁 src                            96 2025-01-13 14:18:20│ ││ ││ ││ ││ ││ ││ ││ ││ │▊▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▎▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔│ │▊…ython/textual-fspicker▎ Select  Cancel │ │▊▁▁▁▁▁▁▁▁▁▁▁▁▁▁▁▁▁▁▁▁▁▁▁▁▁▎▁▁▁▁▁▁▁▁▁▁▁▁▁▁▁▁▁▁▁▁▁▁▁▁▁▁▁▁▁▁▁▁│ ││ └──────────────────────────────────────────────────────────────┘

from textual import work
from textual.app import App

from textual_fspicker import SelectDirectory


class SelectADirectoryApp(App[None]):
    @work
    async def on_mount(self) -> None:
        await self.push_screen_wait(SelectDirectory())


if __name__ == "__main__":
    SelectADirectoryApp().run()