Kivy (framework)
   HOME

TheInfoList



OR:

Kivy is a free and
open source Open source is source code that is made freely available for possible modification and redistribution. Products include permission to use and view the source code, design documents, or content of the product. The open source model is a decentrali ...
Python framework for developing
mobile app A mobile application or app is a computer program or software application designed to run on a mobile device such as a smartphone, phone, tablet computer, tablet, or smartwatch, watch. Mobile applications often stand in contrast to desktop appli ...
s and other
multitouch In computing, multi-touch is technology that enables a surface (a touchpad or touchscreen) to recognize the presence of more than one point of contact with the surface at the same time. The origins of multitouch began at CERN, MIT, University o ...
application software Application software is any computer program that is intended for end-user use not operating, administering or programming the computer. An application (app, application program, software application) is any program that can be categorized as ...
with a natural user interface (NUI). It is distributed under the terms of the
MIT License The MIT License is a permissive software license originating at the Massachusetts Institute of Technology (MIT) in the late 1980s. As a permissive license, it puts very few restrictions on reuse and therefore has high license compatibility. Unl ...
, and can run on Android,
iOS Ios, Io or Nio (, ; ; locally Nios, Νιός) is a Greek island in the Cyclades group in the Aegean Sea. Ios is a hilly island with cliffs down to the sea on most sides. It is situated halfway between Naxos and Santorini. It is about long an ...
,
Linux Linux ( ) is a family of open source Unix-like operating systems based on the Linux kernel, an kernel (operating system), operating system kernel first released on September 17, 1991, by Linus Torvalds. Linux is typically package manager, pac ...
,
macOS macOS, previously OS X and originally Mac OS X, is a Unix, Unix-based operating system developed and marketed by Apple Inc., Apple since 2001. It is the current operating system for Apple's Mac (computer), Mac computers. With ...
, and
Windows Windows is a Product lining, product line of Proprietary software, proprietary graphical user interface, graphical operating systems developed and marketed by Microsoft. It is grouped into families and subfamilies that cater to particular sec ...
. Kivy is the main framework developed by the Kivy organization, alongside Python for Android, Kivy for iOS, and several other libraries meant to be used on all platforms. In 2012, Kivy got a $5000 grant from the
Python Software Foundation The Python Software Foundation (PSF) is an American nonprofit organization devoted to the Python programming language, launched on March 6, 2001. The mission of the foundation is to foster development of the Python community and is responsible fo ...
for porting it to Python 3.3. Kivy also supports the
Raspberry Pi Raspberry Pi ( ) is a series of small single-board computers (SBCs) developed in the United Kingdom by the Raspberry Pi Foundation in collaboration with Broadcom Inc., Broadcom. To commercialize the product and support its growing demand, the ...
which was funded through Bountysource. The framework contains all the elements for building an application such as: * extensive input support for
mouse A mouse (: mice) is a small rodent. Characteristically, mice are known to have a pointed snout, small rounded ears, a body-length scaly tail, and a high breeding rate. The best known mouse species is the common house mouse (''Mus musculus'' ...
, keyboard, TUIO, and OS-specific multitouch events; * a graphic library using only OpenGL ES 2, and based on Vertex Buffer Object and
shader In computer graphics, a shader is a computer program that calculates the appropriate levels of light, darkness, and color during the rendering of a 3D scene—a process known as '' shading''. Shaders have evolved to perform a variety of s ...
s; * a wide range of widgets that support multitouch; * an intermediate language (Kv) used to easily design custom widgets. Kivy is an evolution of the PyMT project.


Code example

Here is an example of the
Hello world program Hello is a salutation or greeting in the English language. It is first attested in writing from 1826. Early uses ''Hello'', with that spelling, was used in publications in the U.S. as early as the 18 October 1826 edition of the '' Norwich Cou ...
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 : 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 Ios, Io or Nio (, ; ; locally Nios, Νιός) is a Greek island in the Cyclades group in the Aegean Sea. Ios is a hilly island with cliffs down to the sea on most sides. It is situated halfway between Naxos and Santorini. It is about long an ...
. * Plyer, platform-independent Python wrapper for platform-dependent
API An application programming interface (API) is a connection between computers or between computer programs. It is a type of software interface, offering a service to other pieces of software. A document or standard that describes how to build ...
s. * PyJNIus, dynamic access to the
Java Java is one of the Greater Sunda Islands in Indonesia. It is bordered by the Indian Ocean to the south and the Java Sea (a part of Pacific Ocean) to the north. With a population of 156.9 million people (including Madura) in mid 2024, proje ...
/ Android
API An application programming interface (API) is a connection between computers or between computer programs. It is a type of software interface, offering a service to other pieces of software. A document or standard that describes how to build ...
from Python. * Pyobjus, dynamic access to the
Objective-C Objective-C is a high-level general-purpose, object-oriented programming language that adds Smalltalk-style message passing (messaging) to the C programming language. Originally developed by Brad Cox and Tom Love in the early 1980s, it was ...
/
iOS Ios, Io or Nio (, ; ; locally Nios, Νιός) is a Greek island in the Cyclades group in the Aegean Sea. Ios is a hilly island with cliffs down to the sea on most sides. It is situated halfway between Naxos and Santorini. It is about long an ...
API An application programming interface (API) is a connection between computers or between computer programs. It is a type of software interface, offering a service to other pieces of software. A document or standard that describes how to build ...
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 Ios, Io or Nio (, ; ; locally Nios, Νιός) is a Greek island in the Cyclades group in the Aegean Sea. Ios is a hilly island with cliffs down to the sea on most sides. It is situated halfway between Naxos and Santorini. It is about long an ...
. * Audiostream, library for direct access to the
microphone A microphone, colloquially called a mic (), or mike, is a transducer that converts sound into an electrical signal. Microphones are used in many applications such as telephones, hearing aids, public address systems for concert halls and publi ...
and speaker. * KivEnt, entity-based
game engine A game engine is a software framework primarily designed for the development of video games which generally includes relevant libraries and support programs such as a level editor. The "engine" terminology is akin to the term " software engine" u ...
for Kivy. * Kivy Garden, widgets and libraries created and maintained by
community A community is a social unit (a group of people) with a shared socially-significant characteristic, such as place, set of norms, culture, religion, values, customs, or identity. Communities may share a sense of place situated in a given g ...
. * Kivy SDK Packager, scripts for Kivy SDK generation on
Windows Windows is a Product lining, product line of Proprietary software, proprietary graphical user interface, graphical operating systems developed and marketed by Microsoft. It is grouped into families and subfamilies that cater to particular sec ...
,
macOS macOS, previously OS X and originally Mac OS X, is a Unix, Unix-based operating system developed and marketed by Apple Inc., Apple since 2001. It is the current operating system for Apple's Mac (computer), Mac computers. With ...
and
Linux Linux ( ) is a family of open source Unix-like operating systems based on the Linux kernel, an kernel (operating system), operating system kernel first released on September 17, 1991, by Linus Torvalds. Linux is typically package manager, pac ...
. * Kivy Remote Shell, remote SSH+ Python interactive shell application. * KivyPie, Raspbian-based distribution running latest Kivy framework on the
Raspberry Pi Raspberry Pi ( ) is a series of small single-board computers (SBCs) developed in the United Kingdom by the Raspberry Pi Foundation in collaboration with Broadcom Inc., Broadcom. To commercialize the product and support its growing demand, the ...
. * OSCPy, a fast and reliable OSC implementation. * Condiment,
preprocessor In computer science, a preprocessor (or precompiler) is a Computer program, program that processes its input data to produce output that is used as input in another program. The output is said to be a preprocessed form of the input data, which i ...
that includes or removes Python code portion, according to
environment variables An environment variable is a user-definable Value (computer science), value that can affect the way running process (computing), processes will behave on a computer. Environment variables are part of the environment in which a process runs. Fo ...
. * KivyAuth,
social login Social login is a form of single sign-on using existing information from a social networking service such as Facebook, Twitter or Google Account, Google, to login to a third party website instead of creating a new login account specifically for tha ...
via
Google Google LLC (, ) is an American multinational corporation and technology company focusing on online advertising, search engine technology, cloud computing, computer software, quantum computing, e-commerce, consumer electronics, and artificial ...
,
Facebook Facebook is a social media and social networking service owned by the American technology conglomerate Meta Platforms, Meta. Created in 2004 by Mark Zuckerberg with four other Harvard College students and roommates, Eduardo Saverin, Andre ...
,
GitHub GitHub () is a Proprietary software, proprietary developer platform that allows developers to create, store, manage, and share their code. It uses Git to provide distributed version control and GitHub itself provides access control, bug trackin ...
and
Twitter Twitter, officially known as X since 2023, is an American microblogging and social networking service. It is one of the world's largest social media platforms and one of the most-visited websites. Users can share short text messages, image ...
accounts in Kivy apps. * KivMob,
AdMob AdMob is a mobile advertising subsidiary of Google, originally founded by the Syrian entrepreneur Omar Hamoui. The name AdMob is a portmanteau for "advertising on mobile". It was incorporated on April 10, 2006 while Hamoui was in business scho ...
support for Kivy apps. * KivyMD, a set of
Material Design Material Design (codename Quantum Paper) is a design language developed by Google in 2014. Expanding on the "cards" UI that debuted in Google Now, Material Design uses more grid-based layouts, responsive animations and transitions, padding, an ...
widgets for Kivy.


Google Summer of Code

Kivy participated in
Google Summer of Code The Google Summer of Code, often abbreviated to GSoC, is an international annual program in which Google awards stipends to contributors who successfully complete a free and open-source software coding project during the summer. , the program is ...
under the
Python Software Foundation The Python Software Foundation (PSF) is an American nonprofit organization devoted to the Python programming language, launched on March 6, 2001. The mission of the foundation is to foster development of the Python community and is responsible fo ...
. * Kivy in GSoC'2014. * Kivy in GSoC'2015. * Kivy in GSoC'2016. * Kivy in GSoC'2017.


See also

*
Pygame Pygame is a cross-platform set of Python modules designed for writing video games. It includes computer graphics and sound libraries designed to be used with the Python programming language. History Pygame was originally written by Pete Shinne ...
, another Python game API, a layer over Simple DirectMedia Layer * Cocos2d * Panda3D *
Pyglet Pyglet is a Library (computing), library for the Python (programming language), Python programming language that provides an Object-oriented programming, object-oriented application programming interface for the creation of games and other multim ...
* Scripting Layer for Android


References


External links

* {{Official website, https://kivy.org/ Cross-platform mobile software Cross-platform software Free software programmed in Python Python (programming language) libraries Software using the MIT license