Kivy Garden

0.1.5 · active · verified Thu Apr 16

Kivy Garden is a project and command-line tool that centralizes user-contributed add-ons, called "flowers," for the Kivy framework. These "flowers" are typically distributed as separate PyPI packages under the `kivy_garden.*` namespace (e.g., `kivy_garden.mapview`). The `kivy-garden` tool facilitates the management and installation of both legacy and modern pip-installable Kivy extensions. It is currently at version 0.1.5 and provides utilities for Kivy developers to extend their applications with community-contributed widgets and tools.

Common errors

Warnings

Install

Imports

Quickstart

This quickstart demonstrates how to create a simple Kivy application displaying an interactive map using the `kivy_garden.mapview` 'flower'. It initializes a MapView widget and places a marker on it, showcasing the standard import and usage pattern for modern Kivy Garden components.

from kivy.app import App
from kivy.uix.boxlayout import BoxLayout
from kivy_garden.mapview import MapView, MapMarker
from kivy.core.window import Window

# Ensure kivy_garden.mapview is installed: pip install kivy_garden.mapview

class MapApp(App):
    def build(self):
        Window.size = (800, 600)
        box = BoxLayout(orientation='vertical')
        # Initialize MapView with example coordinates
        mapview = MapView(zoom=11, lat=50.6394, lon=3.057)
        # Add a marker to the map
        marker = MapMarker(lat=50.6394, lon=3.057, source="atlas://kivy_atlas/data/images/defaulttheme/star")
        mapview.add_marker(marker)
        box.add_widget(mapview)
        return box

if __name__ == '__main__':
    MapApp().run()

view raw JSON →