Kivy (framework)


Kivy is a free and open source Python library for developing mobile apps and other multitouch application software with a natural user interface. It is distributed under the terms of the MIT License, and can run on Android, iOS, GNU/Linux, OS X, and Windows.
Kivy is the main framework developed by the Kivy organization, alongside Python for Android, Kivy iOS, and several other libraries meant to be used on all platforms. In 2012, Kivy got a $5000 grant from the Python Software Foundation for porting it to Python 3.3. Kivy also supports the Raspberry Pi which was funded through Bountysource.
The framework contains all the elements for building an application such as:
Kivy is the evolution of the PyMT project, and is recommended for new projects.

Sister projects

Here is an example of the Hello world program with just one button:

from kivy.app import App
from kivy.uix.button import Button
class TestApp:
def build:
return Button
TestApp.run

Kv language

The Kivy language is a language dedicated to describing user interface and interactions. As with other user interface markup languages, it is possible to easily create a whole UI and attach interaction. For example, to create a Loading dialog that includes a file browser, and a Cancel / Load button, one could first create the base widget in Python and then construct the UI in Kv.
In main.py:

class LoadDialog:
def load: pass
def cancel: pass

And in the associated Kv:

  1. :kivy 1.4.0
:
BoxLayout:
size: root.size
pos: root.pos
orientation: "vertical"
FileChooserListView:
id: filechooser
BoxLayout:
size_hint_y: None
height: 30
Button:
text: "Cancel"
on_release: root.cancel
Button:
text: "Load"
on_release: root.load

Alternatively, the layout and the buttons can be loaded directly in the main.py file.

Google Summer of Code

Kivy participated in Google Summer of Code under Python Software Foundation.