sharing

This module allows you to share items and to import files.

share_items()

Opens a share sheet with given items.

quick_look(path)

Previews given file. This function doesn't block the current thread. You can call this function multiple times and the file path will be appended to the current Preview controller. Thread safe.

FilePicker

(Wraps PyFilePicker)

A class representing a file picker.

Example:


    filePicker = sharing.FilePicker.new()
    filePicker.fileTypes = ["public.data"]
    filePicker.allowsMultipleSelection = True
    
    def files_picked() -> None:
        files = sharing.picked_files()
        sharing.share_items(files)
    
    filePicker.completion = files_picked
    sharing.pick_documents(filePicker)
    

pick_documents(filePicker)

Pick documents with given parameters as a FilePicker.

picked_files()

Returns files picked with pick_documents as URLs.

URLs

open_url(url)

Opens the given URL.