Skip to main content

A reusable tkinter/ttkbootstrap UI framework

Project description

Jabs Mimir

Jabs Mimir is a lightweight, extensible UI micro-framework built on top of tkinter and ttkbootstrap, designed for rapid internal tool development and structured form workflows.

It provides:

  • Reusable UI primitives with validation and tooltips
  • Support for block-based form components with dynamic variable binding
  • Integration with custom validation logic (via resolver or direct functions)
  • Modular architecture suitable for internal tooling and small boilerplate projects

Installation

pip install jabs-mimir

Quick Start

from jabs_mimir import Mimir, DataBlockWrapper, UtilityModule
import tkinter as tk
import ttkbootstrap as tb

class App(tb.Window):
    def __init__(self):
        super().__init__(title="Mimir Demo")
        self.ui = Mimir(self)
        self.ui.setValidatorResolver(lambda name: {"not_empty": lambda val: bool(val.strip())}.get(name))

        self.ui.switchView(self.mainView)

    def mainView(self, ui, *args):
        frame = tb.Frame(self)
        fields = [
            {"type": "heading", "label": "Basic Info"},
            {"label": "Name", "key": "name", "variable": tk.StringVar(), "validation": "not_empty"},
            {"label": "Age", "key": "age", "variable": tk.IntVar()}
        ]

        meta = UtilityModule.buildBlockMeta(fields)
        block = DataBlockWrapper(meta)

        ui.renderFields(frame, fields)
        ui.addNextButton(frame, row=len(fields)+1, command=lambda: print(UtilityModule.getBlockValues(block)))

        return frame

if __name__ == "__main__":
    app = App()
    app.mainloop()

Validation

You can validate fields in two ways:

1. Using a validator file

Create a validator.py:

# include/validator.py
def not_empty(val):
    return bool(str(val).strip())

Load it in your app:

self.ui.setValidatorFile("include/validator.py")

And use string keys in fields:

{"label": "Name", "key": "name", "variable": tk.StringVar(), "validation": "not_empty"}

2. Using a direct function reference

Import the function and assign it directly:

from include.validator import not_empty

fields = [
    {"label": "Name", "key": "name", "variable": tk.StringVar(), "validation": not_empty}
]

Both styles are supported, and Mimir automatically handles focus-out validation, red border styling, and prevents advancement if any fields are invalid.


Components

Mimir

Manages UI views, tooltips, validation, field rendering, and form logic.

DataBlockWrapper

A wrapper for block-level form metadata and values. Supports dot-access and .get()/.set() calls.

UtilityModule

Helper methods for building field metadata, extracting values, validating blocks, etc.


License

MIT License © 2025 William Lydahl

Project details


Release history Release notifications | RSS feed

Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

jabs_mimir-0.4.10.tar.gz (9.8 kB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

jabs_mimir-0.4.10-py3-none-any.whl (9.6 kB view details)

Uploaded Python 3

File details

Details for the file jabs_mimir-0.4.10.tar.gz.

File metadata

  • Download URL: jabs_mimir-0.4.10.tar.gz
  • Upload date:
  • Size: 9.8 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.1.0 CPython/3.11.9

File hashes

Hashes for jabs_mimir-0.4.10.tar.gz
Algorithm Hash digest
SHA256 c982b4e1cda28a17139c3a1c8ca3066f3d334996a66f0350dd3e55b6059e84d2
MD5 48149fecdfb0be0170f67f77c846754d
BLAKE2b-256 3474f80b912a0d109ff3e62cabd982cad594e66840317fe855f03ac377bb51ec

See more details on using hashes here.

File details

Details for the file jabs_mimir-0.4.10-py3-none-any.whl.

File metadata

  • Download URL: jabs_mimir-0.4.10-py3-none-any.whl
  • Upload date:
  • Size: 9.6 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.1.0 CPython/3.11.9

File hashes

Hashes for jabs_mimir-0.4.10-py3-none-any.whl
Algorithm Hash digest
SHA256 540331e10db2a877b6ecb8b07d896801157dd0b5df64e86ae42153611b749c7e
MD5 d06abe2556a9b61d78950d96ecf6f096
BLAKE2b-256 2f5c6cd880c637576c4e23e6408fa43f92ac8b37cf3e49290be73cf618fb6501

See more details on using hashes here.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Pingdom Monitoring Sentry Error logging StatusPage Status page