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 ────────────────────────────────────────────────────────────── 📁 ..                          736 2025-07-15 13:45:47 📁 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               4918 2025-08-11 12:33:49 📄 LICENSE                    1087 2025-01-13 09:23:43▅▅ 📄 Makefile                   3901 2025-08-11 12:46:37 📄 README.md                   889 2025-06-23 15:38:55 ▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔ OpenCancel ▁▁▁▁▁▁▁▁▁▁▁▁▁▁▁▁▁▁▁▁▁▁▁▁▁▁▁▁▁▁▁▁▁▁▁▁▁▁▁▁▁▁▁▁▁▁▁▁▁▁▁▁▁▁▁▁▁ ──────────────────────────────────────────────────────────────

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 ────────────────────────────────────────────────────────────── 📁 ..                          736 2025-07-15 13:45:47 📁 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               4918 2025-08-11 12:33:49 📄 LICENSE                    1087 2025-01-13 09:23:43▅▅ 📄 Makefile                   3901 2025-08-11 12:46:37 📄 README.md                   889 2025-06-23 15:38:55 ▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔ SaveCancel ▁▁▁▁▁▁▁▁▁▁▁▁▁▁▁▁▁▁▁▁▁▁▁▁▁▁▁▁▁▁▁▁▁▁▁▁▁▁▁▁▁▁▁▁▁▁▁▁▁▁▁▁▁▁▁▁▁ ──────────────────────────────────────────────────────────────

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 ─────────────────────────────────────────── 📁 ..                            736 2025-07-15 13:45:47 📁 docs                          128 2025-03-04 08:58:55 📁 src                            96 2025-01-13 14:18:20 ▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔ …ython/textual-fspickerSelectCancel ▁▁▁▁▁▁▁▁▁▁▁▁▁▁▁▁▁▁▁▁▁▁▁▁▁▁▁▁▁▁▁▁▁▁▁▁▁▁▁▁▁▁▁▁▁▁▁▁▁▁▁▁▁▁▁▁▁ ──────────────────────────────────────────────────────────────

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()