Version

Quick search

Core Abstraction

This module defines the abstraction layers for our core providers and their implementations. For further information, please refer to Architectural Overview and the Core Providers and Input Providers section of the documentation.

In most cases, you shouldn’t directly use a library that’s already covered by the core abstraction. Always try to use our providers first. In case we are missing a feature or method, please let us know by opening a new Bug report instead of relying on your library.

Warning

These are not widgets! These are just abstractions of the respective functionality. For example, you cannot add a core image to your window. You have to use the image widget class instead. If you’re really looking for widgets, please refer to kivy.uix instead.

exception kivy.core.CoreCriticalException

Bases: Exception

kivy.core.get_all_categories()

Get list of all provider categories.

Returns:

list: List of all provider category names

New in version 3.0.0.

kivy.core.get_provider_modules(category)

Get dict mapping provider names to module names.

Parameters:
category: str

The provider category (e.g., ‘window’, ‘text’, ‘image’)

Returns:

dict: Dictionary mapping provider_name to module_name

New in version 3.0.0.

kivy.core.get_provider_options(category)

Get tuple of provider names in priority order for kivy_options.

Parameters:
category: str

The provider category (e.g., ‘window’, ‘text’, ‘image’)

Returns:

tuple: Tuple of provider names in priority order

New in version 3.0.0.

kivy.core.make_provider_tuple(provider_name, all_providers, class_name=None)

Create a provider tuple for core_register_libs or core_select_lib.

Helper function to construct provider tuples, eliminating duplication where the provider name appears both as a string and as a dict key.

Parameters:
provider_name: str

The provider name (e.g., ‘sdl3’, ‘pil’, ‘android’)

all_providers: dict

Dictionary returned by get_provider_modules()

class_name: str, optional

Class name for 3-tuple format (used by core_select_lib)

Returns:
tuple: Either (provider_name, module_name) for core_register_libs,

or (provider_name, module_name, class_name) for core_select_lib

Example:
>>> all_providers = get_provider_modules('audio_output')
>>> # 2-tuple format for core_register_libs
>>> make_provider_tuple('sdl3', all_providers)
('sdl3', 'audio_sdl3')
>>> # 3-tuple format for core_select_lib
>>> make_provider_tuple('android', all_providers, 'CameraAndroid')
('android', 'camera_android', 'CameraAndroid')

New in version 3.0.0.