Package: kkappkit
kkAppKitFramework for building small desktop tools with Python andTkinterIntentionsThis project aims to simplify building:Small desktop toolsPrototypes, demos, and tutorialsTarget UsersScientists and engineersTechnical artistsBenefits for End-UsersEasy to add GUI frontend to command-line programs, and release them as standalone appsSimple and consistent layout: All tools made by this kit use single-page and endless-vertical-scroll paradigmsSupports both CLI and GUISupports important common app features out of the box, such as reset-to-default, presets and context helpBenefits for DevelopersAlmost no frontend code to write, thanks to its declarative JSON configuration that drives code generationDecouples frontend-backend developement using the Model-View-Controller architectureCI/CD friendly: ready-to-use build scripts for testing, building, and packaging in the generated appLightweight: The GUI code only depends on small wrapper packages around Python 3 and TkinterHow to install kkappkit?Clone this repoPOSIX:cd kkappkit && sudo ln -s $(pwd)/kkappgen /usr/local/bin/; ensure/usr/local/binis under your system$PATHWindows:cd kkappkit && mklink a\folder\under\your\system\%PATH%\kkappgen.bat .\kkappgen\kkappgen.batHow to work with kkappkit?Initialize a new app project:kkappgen -r /path/to/my_app_root -t <template_name>This generates a Poetry project with a template appLook for template name underres/template/*.app.json; the firstname of the template file is the template nameEditpyproject.tomland install dependencies:cd /path/to/my_app_root && poetry installDesign the app parameter interface by editing the initialized configuration file, e.g.,src/app.jsonGenerate the interface (CLI/GUI) code:kkappgen -r /path/to/my_app_rootImplement the core and hooks as a CLI or GUI or bothRun the CLI or GUI using:runorguiOptionally, dev builds a standalone app bundle for distribution based on the configurationSeedemofolder for examplesWhy not use a full-fledged framework like PySide, PyGTK, or Electron?Most of them are too heavy for small tools, complicating CI and distribution; TkInter as the first-party GUI lib simplifies distributionThose frameworks aim at breadth and come with a steep learning curve (opinions); I want to bake in just enough policies for RAD without making the kit too opinionatedHow to run the demos?The guides below assume:You are a POSIX developer; Windows developers should be able to adapt the steps accordinglyYou have cloned and installedkkappkitYou havepoetryon your systemThe demos must be built before running:The demo assets are located underdemofolder.characteris a form-filling demooscillatoris a controller demoNext, we'll introduce each demo.Charater# create a new skeleton, use -f to force-overwrite existing filescd/path/to/kkappkit
kkappgen-r/path/to/character-ttemplate# navigate to the generated appcd/path/to/character## edit pyproject.toml to add dependencies## then install dependenciesrmpoetry.lock&>/dev/null
poetryinstall# manually edit the configuration file (src/app.json) to fill in app metadata and input/output# and generate the interface code# overwrite the default assets with demo implementationkkappgen-r`pwd`-i/path/to/kkappkit/demo/character# run the app and play around with it./ui# quit the app after done# build the standalone app for local testingci/evaluate# release as a platform-dependent installerci/releaseOscillatorSimilart to the above steps, but the demo assets are located underdemo/oscillator.