CrossFileDialog
A Python wrapper for opening files and folders with the native file dialog.
Makes it easy to prompt the user with a native filepicker on all supported platforms.
Currently supports:
- Zenity (GTK)
- KDialog (KDE)
- Windows Vista and newer
- osascript (macOS)
Basic API usage:
import crossfiledialog
filename = crossfiledialog.open_file()
multiple_filenames = crossfiledialog.open_multiple()
save_filename = crossfiledialog.save_file()
foldername = crossfiledialog.choose_folder()
Documentation
crossfiledialog.open_file(title, start_dir, filter) -> str
Open a file selection dialog for selecting a file.
Parameters:
- title (str, optional) — The title of the file selection dialog. Default is 'Choose a file'
- start_dir (str, optional) — The starting directory for the dialog.
- filter (str, list, dict, optional) — The filter for file types to display. It can be either:
- a single wildcard (e.g.:
"*.py", all files are displayed ending .py) - a list of wildcards (e.g.:
["*.py" "*.md"], all files are displayed ending either .py or .md) - a list of list optional one or more wildcards (e.g.:
[["*.py", "*.md"], ["*.txt"]], user can switch between (.py, .md) and (.txt)) - a dictionary mapping descriptions to wildcards (e.g.:
{"PDF-Files": "*.pdf", "Python Project": ["\*.py", "*.md"]})
- a single wildcard (e.g.:
Returns:
- str: The selected file's path.
crossfiledialog.open_multiple(title, start_dir, filter) -> list[str]
Open a file selection dialog for selecting multiple files.
Parameters:
- title (str, optional) — The title of the file selection dialog. Default is 'Choose one or more files'
- start_dir (str, optional) — The starting directory for the dialog.
- filter (str, list, dict, optional) — The filter for file types to display. It can be either:
- a single wildcard (e.g.:
"*.py", all files are displayed ending .py) - a list of wildcards (e.g.:
["*.py" "*.md"], all files are displayed ending either .py or .md) - a list of list optional one or more wildcards (e.g.:
[["*.py", "*.md"], ["*.txt"]], user can switch between (.py, .md) and (.txt)) - a dictionary mapping descriptions to wildcards (e.g.:
{"PDF-Files": "*.pdf", "Python Project": ["\*.py", "*.md"]})
- a single wildcard (e.g.:
Returns:
- list[str]: A list of selected file paths.
crossfiledialog.save_file(title, start_dir) -> str
Open a save file dialog.
Parameters:
- title (str, optional) — The title of the file selection dialog. Default is 'Enter the name of the file to save to'
- start_dir (str, optional) — The starting directory for the dialog.
Returns:
- str: The selected file's path for saving.
crossfiledialog.choose_folder(title, start_dir) -> str
Open a folder selection dialog.
Parameters:
- title (str, optional) — The title of the file selection dialog. Default is 'Choose a folder'
- start_dir (str, optional) — The starting directory for the dialog.
Returns:
- str: The selected folder's path.
Licence
This software is licensed under the GNU LGPL 3.0 Only. See the LICENSE file for details.
SPDX-License-Identifier: LGPL-3.0-only
Metadata
Release files for crossfiledialog 1.3.1
For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.
Source distribution (sdist)
| File | Size | Uploaded | Provenance | Actions |
|---|---|---|---|---|
| crossfiledialog-1.3.1.tar.gz | 24.9 kB | Without provenance | Details for crossfiledialog-1.3.1.tar.gz |
Built distribution (wheel)
| File | Interpreter | ABI | Platform | Actions Reset |
|---|---|---|---|---|
| crossfiledialog-1.3.1-py3-none-any.whl | Python 3 | none | any | Details for crossfiledialog-1.3.1-py3-none-any.whl |
Total release size: 52.1 kB
Release files / crossfiledialog-1.3.1.tar.gz
| Download URL | crossfiledialog-1.3.1.tar.gz |
|---|---|
| Size | 24.9 kB |
| Tags | Source |
|
SHA-256 checksum How to use checksums |
bb5c645d4a0d5d822bb7e26e4c7f3701ef43b16d6e3093b028f5e8b8c2dca1ef
|
|
BLAKE2b-256 checksum How to use checksums |
cf003d4415b8b6a800b86edeca015f679d3969fd2d3703fbf1f42d96d5c0e454
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
twine/6.1.0 CPython/3.13.5
|
Release files / crossfiledialog-1.3.1-py3-none-any.whl
| Download URL | crossfiledialog-1.3.1-py3-none-any.whl |
|---|---|
| Size | 27.1 kB |
| Tags | Python 3 |
|
SHA-256 checksum How to use checksums |
9e9a89f2589a9a671a9d277b16625ab5794ecafe047deab1c1963635c4a31e2c
|
|
BLAKE2b-256 checksum How to use checksums |
92b4bea60539ce507354384210e6030288c8039403a4ae6f9b88aa97198173ae
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
twine/6.1.0 CPython/3.13.5
|
Security for crossfiledialog 1.3.1
Provenance
Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.
No provenance found
None of the files in this release were uploaded with provenance metadata.
A note on package security
PyPI is a repository for distributing packages, not a service for auditing them. While third-party security researchers and our staff do their best to detect and remove malicious packages, PyPI cannot guarantee the quality, security or suitability of any given package.
To learn more about protecting yourself from malicious actors, visit our package security documentation.