Table Of Contents
Kivy framework¶
Kivy is an open source library for developing multi-touch applications. It is cross-platform (Linux/OSX/Windows/Android/iOS) and released under the terms of the MIT License.
It comes with native support for many multi-touch input devices, a growing library of multi-touch aware widgets and hardware accelerated OpenGL drawing. Kivy is designed to let you focus on building custom and highly interactive applications as quickly and easily as possible.
With Kivy, you can take full advantage of the dynamic nature of Python. There are thousands of high-quality, free libraries that can be integrated in your application. At the same time, performance-critical parts are implemented using Cython.
See http://kivy.org for more information.
- kivy.kivy_base_dir = '/home/runner/work/kivy/kivy/kivy'¶
Kivy directory
- kivy.kivy_config_fn = ''¶
Kivy configuration filename
- kivy.kivy_configure()[source]¶
Call post-configuration of Kivy. This function must be called if you create the window yourself.
- kivy.kivy_data_dir = '/home/runner/work/kivy/kivy/kivy/data'¶
Kivy data directory
- kivy.kivy_examples_dir = '/home/runner/work/kivy/kivy/examples'¶
Kivy examples directory
- kivy.kivy_home_dir = ''¶
Kivy user-home storage directory
- kivy.kivy_icons_dir = '/home/runner/work/kivy/kivy/kivy/data/icons/'¶
Kivy icons config path (don’t remove the last ‘’)
- kivy.kivy_options = {'audio': ('gstplayer', 'pygame', 'ffpyplayer', 'sdl2', 'avplayer'), 'camera': ('opencv', 'gi', 'avfoundation', 'android', 'picamera'), 'clipboard': ('android', 'winctypes', 'xsel', 'xclip', 'dbusklipper', 'nspaste', 'sdl2', 'pygame', 'dummy', 'gtk3'), 'image': ('tex', 'imageio', 'dds', 'sdl2', 'pygame', 'pil', 'ffpy', 'gif'), 'spelling': ('enchant', 'osxappkit'), 'text': ('pil', 'sdl2', 'pygame', 'sdlttf'), 'video': ('gstplayer', 'ffmpeg', 'ffpyplayer', 'null'), 'window': ('egl_rpi', 'sdl2', 'pygame', 'sdl', 'x11')}¶
Global settings options for kivy
- kivy.kivy_register_post_configuration(callback)[source]¶
Register a function to be called when kivy_configure() is called.
Warning
Internal use only.
- kivy.kivy_shader_dir = '/home/runner/work/kivy/kivy/kivy/data/glsl'¶
Kivy glsl shader directory
- kivy.kivy_usermodules_dir = ''¶
Kivy user modules directory
- kivy.parse_kivy_version(version)[source]¶
Parses the kivy version as described in
require()
into a 3-tuple of ([x, y, z], ‘rc|a|b|dev|post’, ‘N’) where N is the tag revision. The last two elements may be None.
- kivy.require(version)[source]¶
Require can be used to check the minimum version required to run a Kivy application. For example, you can start your application code like this:
import kivy kivy.require('1.0.1')
If a user attempts to run your application with a version of Kivy that is older than the specified version, an Exception is raised.
The Kivy version string is built like this:
X.Y.Z[tag[tagrevision]] X is the major version Y is the minor version Z is the bugfixes revision
The tag is optional, but may be one of ‘.dev’, ‘.post’, ‘a’, ‘b’, or ‘rc’. The tagrevision is the revision number of the tag.
Warning
You must not ask for a version with a tag, except -dev. Asking for a ‘dev’ version will just warn the user if the current Kivy version is not a -dev, but it will never raise an exception. You must not ask for a version with a tagrevision.
- Animation
- Simple animation
- Multiple properties and transitions
- Sequential animation
- Parallel animation
- Repeating animation
Animation
AnimationTransition
AnimationTransition.in_back()
AnimationTransition.in_bounce()
AnimationTransition.in_circ()
AnimationTransition.in_cubic()
AnimationTransition.in_elastic()
AnimationTransition.in_expo()
AnimationTransition.in_out_back()
AnimationTransition.in_out_bounce()
AnimationTransition.in_out_circ()
AnimationTransition.in_out_cubic()
AnimationTransition.in_out_elastic()
AnimationTransition.in_out_expo()
AnimationTransition.in_out_quad()
AnimationTransition.in_out_quart()
AnimationTransition.in_out_quint()
AnimationTransition.in_out_sine()
AnimationTransition.in_quad()
AnimationTransition.in_quart()
AnimationTransition.in_quint()
AnimationTransition.in_sine()
AnimationTransition.linear()
AnimationTransition.out_back()
AnimationTransition.out_bounce()
AnimationTransition.out_circ()
AnimationTransition.out_cubic()
AnimationTransition.out_elastic()
AnimationTransition.out_expo()
AnimationTransition.out_quad()
AnimationTransition.out_quart()
AnimationTransition.out_quint()
AnimationTransition.out_sine()
- Application
- Creating an Application
- Application configuration
- Profiling with on_start and on_stop
- Customising layout
- Pause mode
- Asynchronous app
- Interacting with Kivy app from other coroutines
App
App.async_run()
App.build()
App.build_config()
App.build_settings()
App.close_settings()
App.config
App.create_settings()
App.destroy_settings()
App.directory
App.display_settings()
App.get_application_config()
App.get_application_icon()
App.get_application_name()
App.get_running_app()
App.icon
App.kv_directory
App.kv_file
App.load_config()
App.load_kv()
App.name
App.on_config_change()
App.on_pause()
App.on_resume()
App.on_start()
App.on_stop()
App.open_settings()
App.options
App.pause()
App.root
App.root_window
App.run()
App.settings_cls
App.stop()
App.title
App.use_kivy_settings
App.user_data_dir
async_runTouchApp()
runTouchApp()
stopTouchApp()
- Asynchronous data loader
- Atlas
- Cache manager
- Clock object
- Schedule before frame
- Triggered Events
- Unscheduling
- Clock Lifecycle
- Exception Handling
- Scheduling from
__del__
- Threading and Callback Order
- Advanced Clock Details
- Async clock support
Clock
ClockBase
ClockBaseBehavior
ClockBaseBehavior.MIN_SLEEP
ClockBaseBehavior.async_idle()
ClockBaseBehavior.async_tick()
ClockBaseBehavior.frames
ClockBaseBehavior.frames_displayed
ClockBaseBehavior.frametime
ClockBaseBehavior.get_boottime()
ClockBaseBehavior.get_fps()
ClockBaseBehavior.get_rfps()
ClockBaseBehavior.get_time()
ClockBaseBehavior.idle()
ClockBaseBehavior.init_async_lib()
ClockBaseBehavior.post_idle()
ClockBaseBehavior.pre_idle()
ClockBaseBehavior.tick()
ClockBaseBehavior.tick_draw()
ClockBaseBehavior.time()
ClockBaseBehavior.usleep()
ClockBaseFreeInterruptAll
ClockBaseFreeInterruptOnly
ClockBaseInterrupt
ClockBaseInterruptBehavior
ClockBaseInterruptFreeBehavior
ClockEvent
ClockEvent.callback
ClockEvent.cancel()
ClockEvent.cid
ClockEvent.clock
ClockEvent.clock_ended_callback
ClockEvent.get_callback()
ClockEvent.get_clock_ended_callback()
ClockEvent.is_triggered
ClockEvent.loop
ClockEvent.next
ClockEvent.prev
ClockEvent.release()
ClockEvent.release_ref
ClockEvent.tick()
ClockEvent.timeout
ClockEvent.weak_callback
ClockEvent.weak_clock_ended_callback
ClockNotRunningError
CyClockBase
CyClockBase.clock_resolution
CyClockBase.create_lifecycle_aware_trigger()
CyClockBase.create_trigger()
CyClockBase.get_before_frame_events()
CyClockBase.get_events()
CyClockBase.get_min_timeout()
CyClockBase.get_resolution()
CyClockBase.handle_exception()
CyClockBase.has_ended
CyClockBase.has_started
CyClockBase.max_iteration
CyClockBase.on_schedule()
CyClockBase.schedule_del_safe()
CyClockBase.schedule_interval()
CyClockBase.schedule_lifecycle_aware_del_safe()
CyClockBase.schedule_once()
CyClockBase.start_clock()
CyClockBase.stop_clock()
CyClockBase.unschedule()
CyClockBaseFree
CyClockBaseFree.create_lifecycle_aware_trigger()
CyClockBaseFree.create_lifecycle_aware_trigger_free()
CyClockBaseFree.create_trigger()
CyClockBaseFree.create_trigger_free()
CyClockBaseFree.get_min_free_timeout()
CyClockBaseFree.schedule_interval()
CyClockBaseFree.schedule_interval_free()
CyClockBaseFree.schedule_once()
CyClockBaseFree.schedule_once_free()
FreeClockEvent
mainthread()
triggered()
- Compatibility module for Python 2.7 and >= 3.4
- Configuration object
- Applying configurations
- Usage of the Config object
- Changing configuration with environment variables
- Available configuration tokens
Config
ConfigParser
ConfigParser.add_callback()
ConfigParser.adddefaultsection()
ConfigParser.get()
ConfigParser.get_configparser()
ConfigParser.getdefault()
ConfigParser.getdefaultint()
ConfigParser.name
ConfigParser.read()
ConfigParser.remove_callback()
ConfigParser.set()
ConfigParser.setall()
ConfigParser.setdefault()
ConfigParser.setdefaults()
ConfigParser.update_config()
ConfigParser.write()
- Context
- Event dispatcher
EventDispatcher
EventDispatcher.apply_property()
EventDispatcher.bind()
EventDispatcher.create_property()
EventDispatcher.dispatch()
EventDispatcher.dispatch_children()
EventDispatcher.dispatch_generic()
EventDispatcher.events()
EventDispatcher.fbind()
EventDispatcher.funbind()
EventDispatcher.get_property_observers()
EventDispatcher.getter()
EventDispatcher.is_event_type()
EventDispatcher.properties()
EventDispatcher.property()
EventDispatcher.proxy_ref
EventDispatcher.register_event_type()
EventDispatcher.setter()
EventDispatcher.unbind()
EventDispatcher.unbind_uid()
EventDispatcher.unregister_event_type()
EventDispatcher.unregister_event_types()
ObjectWithUid
Observable
- Factory object
- Geometry utilities
- Gesture recognition
- Interactive launcher
- Kivy Base
EventLoop
EventLoopBase
EventLoopBase.add_event_listener()
EventLoopBase.add_input_provider()
EventLoopBase.add_postproc_module()
EventLoopBase.async_idle()
EventLoopBase.close()
EventLoopBase.dispatch_input()
EventLoopBase.ensure_window()
EventLoopBase.exit()
EventLoopBase.idle()
EventLoopBase.on_pause()
EventLoopBase.on_start()
EventLoopBase.on_stop()
EventLoopBase.post_dispatch_input()
EventLoopBase.remove_android_splash()
EventLoopBase.remove_event_listener()
EventLoopBase.remove_input_provider()
EventLoopBase.remove_postproc_module()
EventLoopBase.run()
EventLoopBase.set_window()
EventLoopBase.start()
EventLoopBase.stop()
EventLoopBase.touches
ExceptionHandler
ExceptionManager
ExceptionManagerBase
async_runTouchApp()
runTouchApp()
stopTouchApp()
- Kivy Logging
- Low level Metrics
- Metrics
- Multistroke gesture recognizer
- Parser utilities
- Properties
- Comparison Python vs. Kivy
- Observe Property changes
- Binding to properties of properties.
AliasProperty
BooleanProperty
BoundedNumericProperty
ColorProperty
ConfigParserProperty
DictProperty
ListProperty
NumericProperty
ObjectProperty
OptionProperty
Property
ReferenceListProperty
StringProperty
VariableListProperty
- Resources management
- Support
- Utils
- Vector
- Weak Method
- Weak Proxy