Software:Kivy (framework)
The Kivy Showcase example | |
Developer(s) | Kivy organization |
---|---|
Initial release | 1 February 2011[1] |
Stable release | 2.2.1
/ 17 June 2023[2] |
Repository | github |
Written in | Python, Cython |
Operating system | Cross-platform |
Type | Application framework |
License | MIT (Free software) |
Website | kivy |
Kivy is a free and open source Python framework for developing mobile apps and other multitouch application software with a natural user interface (NUI). It is distributed under the terms of the MIT License, and can run on Android, iOS, Linux, macOS, and Windows.
Kivy is the main framework developed by the Kivy organization,[3] alongside Python for Android,[4] Kivy iOS,[5] 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.[6] Kivy also supports the Raspberry Pi which was funded through Bountysource.[7]
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)[8] used to easily design custom widgets.
Kivy is an evolution of the PyMT project.[9]
Code example
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()
Kv language
The Kv language is a language dedicated to describing user interface and interactions in Kivy framework. 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(FloatLayout): def load(self, filename): pass def cancel(self): pass
And in the associated Kv:
#:kivy 1.11.1 <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)
Alternatively, the layout (here, Box Layout) and the buttons can be loaded directly in the main.py file.
Related projects
- Buildozer, generic Python packager for Android and iOS.
- Plyer, platform-independent Python wrapper for platform-dependent APIs.
- PyJNIus, dynamic access to the Java/Android API from Python.
- Pyobjus, dynamic access to the Objective-C/iOS API from Python.
- Python for Android, toolchain for building and packaging Python applications for Android.
- Kivy for iOS, toolchain for building and packaging Kivy applications for iOS.
- Audiostream, library for direct access to the microphone and speaker.
- KivEnt, entity-based game engine for Kivy.
- Kivy Garden, widgets and libraries created and maintained by community.
- Kivy SDK Packager, scripts for Kivy SDK generation on Windows, macOS and Linux.
- Kivy Remote Shell, remote SSH+Python interactive shell application.
- KivyPie, Raspbian-based distribution running latest Kivy framework on the Raspberry Pi.
- OSCPy, a fast and reliable OSC implementation.
- Condiment, preprocessor that includes or removes Python code portion, according to environment variables.
- KivyAuth, social login via Google, Facebook, GitHub and Twitter accounts in Kivy apps.
- KivMob, AdMob support for Kivy apps.
- KivyMD, a set of Material Design widgets for Kivy.
Google Summer of Code
Kivy participated in Google Summer of Code under the Python Software Foundation.
See also
- Pygame, another Python game API, a layer over Simple DirectMedia Layer
- Cocos2d
- Panda3D
- Pyglet
- Scripting Layer for Android
References
- ↑ "Kivy changelog", kivy.org, https://kivy.org/#changelog, retrieved 2016-04-05
- ↑ "Kivy 2.2.1". 2022-06-17. https://github.com/kivy/kivy/releases/tag/2.2.1.
- ↑ "About us", kivy.org, https://kivy.org/#aboutus
- ↑ "Python for Android", github.com, https://github.com/kivy/python-for-android
- ↑ "Kivy for iOS", github.com, https://github.com/kivy/kivy-ios
- ↑ "Kivy and Python 3.3, project started", Google Groups, https://groups.google.com/d/topic/kivy-users/5Z_UJOoBeIc/discussion
- ↑ "Kivy on Raspberry Pi", bountysource.com, https://www.bountysource.com/#fundraisers/143-kivy-on-raspberry-pi
- ↑ "Programming Guide » Kv language", kivy.org, https://kivy.org/docs/guide/lang.html
- ↑ "FAQ: How is Kivy related to PyMT?", kivy.org, https://kivy.org/docs/faq.html#how-is-kivy-related-to-pymt, retrieved 2012-06-09
- ↑ "Google Summer of Code 2014 @ the Python Software Foundation". https://www.google-melange.com/archive/gsoc/2014/orgs/python.
- ↑ "Google Summer of Code 2015 @ the Python Software Foundation". https://www.google-melange.com/archive/gsoc/2015/orgs/python.
- ↑ "Google Summer of Code 2016 @ the Python Software Foundation". https://wiki.python.org/moin/SummerOfCode/2016.
- ↑ "Google Summer of Code 2017 @ the Python Software Foundation". https://python-gsoc.org/2017/.
External links
Original source: https://en.wikipedia.org/wiki/Kivy (framework).
Read more |