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[source]

Bases: Exception

kivy.core.PROVIDER_CONFIGS = {'audio_output': [('gstplayer', 'audio_gstplayer'), ('ffpyplayer', 'audio_ffpyplayer'), ('sdl3', 'audio_sdl3'), ('avplayer', 'audio_avplayer'), ('android', 'audio_android')], 'camera': [('opencv', 'camera_opencv'), ('gi', 'camera_gi'), ('avfoundation', 'camera_avfoundation'), ('android', 'camera_android'), ('picamera', 'camera_picamera')], 'clipboard': [('android', 'clipboard_android'), ('winctypes', 'clipboard_winctypes'), ('xsel', 'clipboard_xsel'), ('xclip', 'clipboard_xclip'), ('dbusklipper', 'clipboard_dbusklipper'), ('nspaste', 'clipboard_nspaste'), ('sdl3', 'clipboard_sdl3'), ('dummy', 'clipboard_dummy'), ('gtk3', 'clipboard_gtk3')], 'image': [('tex', 'img_tex'), ('imageio', 'img_imageio'), ('dds', 'img_dds'), ('sdl3', 'img_sdl3'), ('pil', 'img_pil'), ('ffpy', 'img_ffpyplayer'), ('thorvg_svg', 'img_thorvg_svg')], 'lottie': [('thorvg', 'lottie_thorvg'), ('null', 'lottie_null')], 'spelling': [('enchant', 'spelling_enchant'), ('osxappkit', 'spelling_osxappkit')], 'svg': [('thorvg', 'svg_thorvg')], 'text': [('pil', 'text_pil'), ('sdl3', 'text_sdl3'), ('pango', 'text_pango')], 'video': [('avfoundation', 'video_avfoundation'), ('gstplayer', 'video_gstplayer'), ('ffmpeg', 'video_ffmpeg'), ('ffpyplayer', 'video_ffpyplayer'), ('null', 'video_null')], 'window': [('egl_rpi', 'window_egl_rpi'), ('sdl3', 'window_sdl3'), ('x11', 'window_x11')]}

Centralized provider configuration registry. Single source of truth for all Kivy core providers.

Each provider list defines both the available providers and their priority order (first = highest priority).

Added in version 3.0.0.

kivy.core.get_all_categories()[source]

Get list of all provider categories.

Returns:

list: List of all provider category names

Added in version 3.0.0.

kivy.core.get_provider_modules(category)[source]

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

Added in version 3.0.0.

kivy.core.get_provider_options(category)[source]

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

Added in version 3.0.0.

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

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')

Added in version 3.0.0.