Description
I'm working with Python Shiny and need to implement server-side file selection functionality (let users select files that already exist on the server, not upload local files from the client side).
In R Shiny, the shinyFiles package provides a mature solution for this scenario: it can list files/directories on the server, allow users to navigate server directories interactively, select files/folders, and return the server-side paths to the app logic.
I wonder if Python Shiny currently has an official/community-maintained package/tool that achieves the same goal? If not, I'd like to discuss the feasible approaches to develop such a feature for Python Shiny.
Current Workaround (Temporary Solution)
At present, I've implemented a basic version by:
Reading the server directory via os.listdir()/pathlib in the server logic
Dynamically generating a dropdown/checkbox group with ui.input_select()/ui.input_checkbox_group() to display file lists
Returning the full server path of the selected file to read/process it
However, this approach has limitations:
No interactive directory navigation (users can't browse subdirectories on the server)
Lack of file type filtering, pagination (for large file lists), and other user-friendly features
No support for selecting directories (only files)
Questions & Discussion Points
Does Python Shiny have a built-in/third-party solution equivalent to R's shinyFiles?
If not, what's the recommended architecture to develop this feature? For example:
Extending Python Shiny's UI components to support interactive directory browsing
Wrapping file system operations into reactive functions to sync server directory changes
Ensuring security (restricting access to specific server directories to avoid path traversal risks)
Are there any existing design patterns/APIs in Python Shiny that we can reuse for this development?
Thanks for your attention and guidance!
Description
I'm working with Python Shiny and need to implement server-side file selection functionality (let users select files that already exist on the server, not upload local files from the client side).
In R Shiny, the shinyFiles package provides a mature solution for this scenario: it can list files/directories on the server, allow users to navigate server directories interactively, select files/folders, and return the server-side paths to the app logic.
I wonder if Python Shiny currently has an official/community-maintained package/tool that achieves the same goal? If not, I'd like to discuss the feasible approaches to develop such a feature for Python Shiny.
Current Workaround (Temporary Solution)
At present, I've implemented a basic version by:
Reading the server directory via os.listdir()/pathlib in the server logic
Dynamically generating a dropdown/checkbox group with ui.input_select()/ui.input_checkbox_group() to display file lists
Returning the full server path of the selected file to read/process it
However, this approach has limitations:
No interactive directory navigation (users can't browse subdirectories on the server)
Lack of file type filtering, pagination (for large file lists), and other user-friendly features
No support for selecting directories (only files)
Questions & Discussion Points
Does Python Shiny have a built-in/third-party solution equivalent to R's shinyFiles?
If not, what's the recommended architecture to develop this feature? For example:
Extending Python Shiny's UI components to support interactive directory browsing
Wrapping file system operations into reactive functions to sync server directory changes
Ensuring security (restricting access to specific server directories to avoid path traversal risks)
Are there any existing design patterns/APIs in Python Shiny that we can reuse for this development?
Thanks for your attention and guidance!