Skip to main content

Kaki - Advanced application library for Kivy

This library enhance Kivy frameworks with opiniated features such as:

  • Auto reloading kv or py (watchdog required, limited to some uses cases)
  • Idle detection support
  • Foreground lock (windows only)

Example

This is a bootstrap that will:

  • automatically declare the module live.ui (live/ui.py) as a provider for the widget UI
  • build the application widget, and show it to a window

If the bootstrap is started with the environment variable DEBUG=1, it will start a watchdog, and listen for changes, according to AUTORELOADER_PATHS. When something changes, the current application widget will be cleared out, and a new one will be instanciated, after reloading.

from kaki.app import App
from kivy.factory import Factory

class Live(App):
    CLASSES = {
        "UI": "live.ui"
    }
    AUTORELOADER_PATHS = [
        (".", {"recursive": True}),
    ]
    def build_app(self):
        return Factory.UI()

Live().run()

Application class configuration

#: Control either we activate debugging in the app or not
#: Defaults depend if "DEBUG" exists in os.environ
DEBUG = "DEBUG" in os.environ

#: If true, it will require the foreground lock on windows
FOREGROUND_LOCK = False

#: List of KV files under management for auto reloader
KV_FILES = []

#: List of path to watch for autoreloading
AUTORELOADER_PATHS = [
    # (".", {"recursive": False}),
]

#: List of extensions to ignore
AUTORELOADER_IGNORE_PATTERNS = [
    "*.pyc", "*__pycache__*"]

#: Factory classes managed by kaki
CLASSES = {}

#: Idle detection (if True, event on_idle/on_wakeup will be fired)
#: Rearming idle can also be done with rearm_idle()
IDLE_DETECTION = False

#: Auto install idle detection check when activated
IDLE_DETECTION_AUTO_START = True

#: Default idle timeout
IDLE_TIMEOUT = 60

#: Raise error
#: When the DEBUG is activated, it will raise any error instead
#: of showing it on the screen. If you still want to show the error
#: when not in DEBUG, put this to False
RAISE_ERROR = True

Idle Management

The idle detection feature is designed to trigger an action if the user has not touched the screen for a certain period of time. This can be used to display an attractor screen, screensaver, or other content.

To enable idle detection, set the IDLE_DETECTION configuration to True. Kaki will then listen for touch down/move events. If no such events occur within the IDLE_TIMEOUT interval, or if the rearm_idle function has not been called, the on_idle event will be triggered on the application class. If a touch event occurs or rearm_idle is called while the system is in idle mode, the on_wakeup event will be triggered on the application class.

If you are playing a video and do not want idle detection to be triggered, you can use the rearm_idle function on the application class to reset the idle timer to 0 seconds.

Metadata

Release files for kaki 0.1.9

For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.

Source distribution (sdist)

Source distribution for kaki 0.1.9
File Size Uploaded Provenance
kaki-0.1.9.tar.gz 8.9 kB Without provenance Details

Built distribution (wheel)

Table of built distributions (wheels) for kaki 0.1.9
File Interpreter ABI Platform
kaki-0.1.9-py2.py3-none-any.whl Python 2, Python 3 none any Details

Total release size: 16.2 kB

Release files / kaki-0.1.9.tar.gz

Download URL kaki-0.1.9.tar.gz
Size 8.9 kB
Tags Source
SHA-256 checksum
How to use checksums
63093bbc83ed930e29f0fe29ece69061b806911c61f64cb99329e2d9a56dac5f
BLAKE2b-256 checksum
How to use checksums
c53397ae6277588ec73f6b9715c136e083368956f206f26bfd443a8401e87548
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/4.0.2 CPython/3.11.3

Release files / kaki-0.1.9-py2.py3-none-any.whl

Download URL kaki-0.1.9-py2.py3-none-any.whl
Size 7.3 kB
Tags Python 2 Python 3
SHA-256 checksum
How to use checksums
fdc868a0b98a72b751ef87172897df6d89ac1a453f8e577156d0ce953208ae9a
BLAKE2b-256 checksum
How to use checksums
157bb267a6fc6adc894ee5b3361a4c7938b415eb996bd6cadf18df346ea50662
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/4.0.2 CPython/3.11.3

Security for kaki 0.1.9

Provenance

Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.

No provenance found

None of the files in this release were uploaded with provenance metadata.

A note on package security

PyPI is a repository for distributing packages, not a service for auditing them. While third-party security researchers and our staff do their best to detect and remove malicious packages, PyPI cannot guarantee the quality, security or suitability of any given package.

Anthropic, PBC Visionary sponsor Bloomberg Visionary sponsor Hudson River Trading Visionary sponsor Meta Visionary sponsor NVIDIA Visionary sponsor Microsoft Sustainability sponsor Depot Continuous Integration AWS Cloud computing and Security Sponsor Datadog Monitoring Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page