Skip to main content

Python file chooser widget for use in Jupyter/IPython in conjunction with ipywidgets

Project description

ipyfilechooser

A simple Python file chooser widget for use in Jupyter/IPython in conjunction with ipywidgets. The selected path and file are available via .selected_path and .selected_filename respectvely or as a single combined filepath via .selected. The dialog can be reset to its default path and filename by using .reset().

When a typed filename matches an existing file entry in the current folder the entry will be highlighted. To emphasize the risk of overwriting existing files, the selected filepath is displayed in green if the file does not exist and orange if it does.

Usage

from ipyfilechooser import FileChooser

# Create and display a FileChooser widget
fc = FileChooser('/Users/crahan/FC demo')
display(fc)

# Print the selected path, filename, or both
print(fc.selected_path)
print(fc.selected_filename)
print(fc.selected)

# Change defaults and reset the dialog
fc.default_path = '/Users/crahan/'
fc.default_filename = 'output.txt'
fc.reset()

# Shorthand reset
fc.reset(path='/Users/crahan/', filename='output.txt')

# Change hidden files
fc.show_hidden = True

Functions and variables

fc.reset()
fc.refresh()
fc.show_hidden
fc.rows
fc.default
fc.default_path
fc.default_filename
fc.selected
fc.selected_path
fc.selected_filename

Screenshots

Closed vs open dialog

Screenshot 1

Screenshot 2

Existing vs new file selection

Screenshot 3

Screenshot 4

Quick navigation dropdown

Screenshot 5

Project details


Download files

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

Source Distribution

ipyfilechooser-0.1.2.tar.gz (4.5 kB view hashes)

Uploaded Source

Built Distribution

ipyfilechooser-0.1.2-py3-none-any.whl (5.9 kB view hashes)

Uploaded Python 3

Supported by

AWS AWS Cloud computing and Security Sponsor Datadog Datadog Monitoring Fastly Fastly CDN Google Google Download Analytics Microsoft Microsoft PSF Sponsor Pingdom Pingdom Monitoring Sentry Sentry Error logging StatusPage StatusPage Status page