Metadata-Version: 2.1
Name: pyqt5-file-dialogs
Version: 1.0.0
Summary: Interactive file selection prompts using Qt5.
Home-page: https://github.com/timothypettingill/pyqt5-file-dialogs
Author: Timothy Pettingill
Author-email: tpettingill@outlook.com
License: UNKNOWN
Platform: UNKNOWN
Classifier: Development Status :: 5 - Production/Stable
Classifier: License :: OSI Approved :: MIT License
Classifier: Operating System :: OS Independent
Classifier: Intended Audience :: Developers
Classifier: Programming Language :: Python :: 3
Classifier: Programming Language :: Python :: 3.6
Classifier: Programming Language :: Python :: 3.7
Classifier: Programming Language :: Python :: 3.8
Classifier: Programming Language :: Python :: 3 :: Only
Requires-Python: >=3.6
Description-Content-Type: text/markdown
Requires-Dist: PySide2

# pyqt5-file-dialogs
Interactive file selection prompts using Qt5.

## Usage

```python
import json
from pathlib import Path

from pyqt5filedialogs import get_open_filepath, get_save_filepath

def read_data():
    """
    Load data from a JSON file selected by the user.
    """
    filepath = get_open_filepath(caption="Select a JSON data file.")
    with open(filepath, 'r') as f:
        data = json.load(f)
    return data

def export_config():
    """
    Export a config `dict` object to a JSON file selected by the user.
    """
    config = {
        'preferences': {
            'theme': 'light',
            'font_size': 16,
            'font_family': 'Roboto',
        }
    }

    config_dir = Path.home().joinpath('.config', 'myapp')
    if not config_dir.exists():
        config_dir.mkdir(parents=True)
    filepath = get_save_filepath(filter='JSON Files (*.json)')
    with open(filepath, 'w') as f:
        json.dump(config, f)
    return filepath.stat().st_size
```

## Installation

Install with pip.

```bash
$ pip install pyqt5filedialogs
```

## Dependencies

* `PySide2` - Qt5 bindings for Python.

