|This article needs additional citations for verification. (June 2012) (Learn how and when to remove this template message)|
The Kivy Showcase example
|Initial release||February 1, 2011|
1.9.1 / 1 January 2016
|Written in||Python, Cython|
|License||MIT (Free software)|
Kivy is an open source Python library for developing mobile apps and other multitouch application software with a natural user interface (NUI). It can run on Android, iOS, Linux, OS X, and Windows. Distributed under the terms of the MIT license, Kivy is free and open source software.
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:
- extensive input support for mouse, keyboard, TUIO, and OS-specific multitouch events,
- a graphic library using only OpenGL ES 2, and based on Vertex Buffer Object and shaders,
- a wide range of Widgets that support multitouch,
- an intermediate language (Kv) used to easily design custom Widgets.
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(App): def build(self): return Button(text='Hello World') TestApp().run()
The Kivy language (Kv) is a language dedicated to describing user interface and interactions. As with QML, 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.
class LoadDialog(FloatLayout): def load(self, filename): pass def cancel(self): pass
And in the associated Kv:
#:kivy 1.4.0 <LoadDialog>: 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(filechooser.path, filechooser.selection)
- "Kivy changelog", kivy.org, retrieved 2016-04-05
- "About us", kivy.org
- "Python for Android", github.com
- "Kivy for iOS", github.com
- "Kivy and Python 3.3, project started", Google Groups
- "Kivy on Raspberry Pi", bountysource.com
- "Programming Guide » Kv language", kivy.org
- "FAQ: How is Kivy related to PyMT?", kivy.org, retrieved 2012-06-09
|This computer-library-related article is a stub. You can help Wikipedia by expanding it.|
|This free-software-related article is a stub. You can help Wikipedia by expanding it.|