Skip to content

flatpak module

FlatpakPackage

Detailed information about one installed flatpak package, as a FlatpakPackageInfo.

Commands:

flatpak info <package> 2>/dev/null || true

Returns:

FlatpakPackageInfo | None

Raises:

HostConnectionError

Examples:

Examples can be found in examples/modules/flatpak/flatpak_flatpak_package.py.

FlatpakPackageInfo

Attributes:

Name Type Description
id

The application's reverse-domain ID (the ID: row), e.g. "org.videolan.VLC".

ref

The full install ref (the Ref: row), "app/org.videolan.VLC/x86_64/stable".

version

The installed version read from the Version: row ("3.0.21", "21.0-Omega"); "" when flatpak prints none (a runtime has no Version: row).

FlatpakPackages

The application IDs of the installed flatpak packages.

Commands:

flatpak list --columns=application 2>/dev/null || true

Returns:

list[str]

Raises:

HostConnectionError

Examples:

Examples can be found in examples/modules/flatpak/flatpak_packages.py.

packages async

packages(
    ctx: OpContext,
    packages: str
    | list[str]
    | tuple[str, ...]
    | None = None,
    remote: str | None = None,
    present: bool = True,
    **kwargs: Any,
) -> AsyncGenerator[Command]

Install or remove flatpak application packages.

Parameters:

Name Type Description Default
ctx OpContext

Execution context for the operation.

required
packages str | list[str] | tuple[str, ...] | None

Application IDs to ensure. Prefer tuples when building requests via op(), since OperationRequest kwargs must stay hashable. Defaults to None.

None
remote str | None

The remote to install the applications from (e.g. "flathub"); omitted means flatpak's default. Ignored when removing. Defaults to None.

None
present bool

Whether the applications should be installed. Defaults to True.

True
**kwargs Any

Additional keyword arguments.

{}

Yields:

Name Type Description
Command AsyncGenerator[Command]

Generated flatpak package commands.

Raises:

HostConnectionError

Examples:

Examples can be found in examples/modules/flatpak/flatpak_packages.py.