Package: bun
BunBun (Basicuser interface) is a small Python package for a basic user interface.Table of contentsIntroductionInstallationUsageKnown issues and limitationsGetting helpContributingLicenseAuthors and historyAcknowledgmentsIntroductionThis package grew out of a desire to satisfy two goals simultaneously: (1) have the simplest possible coding interface for printing color-coded messages and getting basic information from the user; and (2) let the user choose to use a command-line interface (CLI) or a graphical user interface (GUI) at run time.  Bun (Basicuser interface) is the result.  It provides functions such asinform,warn,alertand others, which you can use in code like this:ifwritable(dest_dir):inform(f'Will write output to{dest_dir}.')else:alert(f'Output destination{dest_dir}is not writable.')Bun is simple and limited in functionality, as well as being somewhat opinionated in its design, but it satisfies the needs of many programs.  Bun wraps packages such asRichandwxPythonto provide simple high-level calls.  Here is some sample output from an application that uses Bun:Many user interface packages already exist for Python, but their use requires configuration and more complicated code to use.  Bun aims to be simpler.InstallationThe instructions below assume you have a Python interpreter installed on your computer; if that's not the case, please firstinstall Python version 3and familiarize yourself with running Python programs on your system.OnLinux,macOS, andWindowsoperating systems, you should be able to installbunwithpip.  To installbunfrom thePython package repository (PyPI), run the following command:python3 -m pip install bun --upgradeAs an alternative to getting it fromPyPI, you can usepipto installbundirectly from GitHub, like this:python3-mpipinstallgit+https://github.com/caltechlibrary/bun.git--upgradeUsage[... forthcoming ...]Known issues and limitationsAs of version 0.0.5, the code for the GUI version is currently not included in the released version of Bun.  The original code is in fact used by some applications, but the generalization and incorporation of that code into Bun is incomplete, so until more work is done, the GUI code is kept in a separate git branch (gui).Getting helpIf you find an issue, please submit it inthe GitHub issue trackerfor this repository.ContributingWe would be happy to receive your help and participation with enhancing Bun!  Please visit theguidelines for contributingfor some tips on getting started.LicenseSoftware produced by the Caltech Library is Copyright (C) 2020, Caltech.  This software is freely distributed under a BSD/MIT type license.  Please see theLICENSEfile for more information.Authors and historyI developed the first version of this code while implementingHoldit.  I started using the code in essentially every Python software package I have written since then, first by copy-pasting the code (which was initially very short) and eventually creating a single-file module (namedui.py).  This was obviously a suboptimal approach.  Finally, in 2020, I decided it was time to break it out into a proper self-contained Python package.AcknowledgmentsThis work was funded by the California Institute of Technology Library.Thevector artworkof a bun, used as the icon for this repository, was created byVectors Marketfrom the Noun Project.  It is licensed under the Creative CommonsCC-BY 3.0license.