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│ │──────────────────────────────────────────────────────────────│ ││ │📁 ..                          960 2026-11-08 10:25:06│ │📁 dist                        160 2026-12-03 19:11:03│ │📁 docs                        128 2026-08-04 21:31:37│ │📁 src                          96 2026-08-04 21:31:37│ │📄 CONTRIBUTING.md            1787 2026-08-04 21:31:37│ │📄 ChangeLog.md               6257 2026-12-03 19:10:49▅▅│ │📄 LICENSE                    1087 2026-08-04 21:31:37│ │📄 Makefile                   3920 2026-08-04 21:31: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│ │──────────────────────────────────────────────────────────────│ ││ │📁 ..                          960 2026-11-08 10:25:06│ │📁 dist                        160 2026-12-03 19:11:03│ │📁 docs                        128 2026-08-04 21:31:37│ │📁 src                          96 2026-08-04 21:31:37│ │📄 CONTRIBUTING.md            1787 2026-08-04 21:31:37│ │📄 ChangeLog.md               6257 2026-12-03 19:10:49▅▅│ │📄 LICENSE                    1087 2026-08-04 21:31:37│ │📄 Makefile                   3920 2026-08-04 21:31: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 ───────────────────────────────────────────┐ │/Users/davep/develop/python/textual-fspicker│ │──────────────────────────────────────────────────────────────│ ││ │📁 ..                            960 2026-11-08 10:25:06│ │📁 dist                          160 2026-12-03 19:11:03│ │📁 docs                          128 2026-08-04 21:31:37│ │📁 src                            96 2026-08-04 21:31:37│ ││ ││ ││ ││ ││ ││ │▊▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▎▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔│ │▊▎ 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()