Bun<img width="11%" align="right" src="https://github.com/caltechlibrary/bun/raw/main/.graphics/bun-icon.png">
===========================================================================
Bun (_**B**asic **u**ser i**n**terface_) is a small Python package for a basic user interface.
[![License](https://img.shields.io/badge/License-BSD%203--Clause-blue.svg?style=flat-square)](https://choosealicense.com/licenses/bsd-3-clause)
[![Latest release](https://img.shields.io/github/v/release/caltechlibrary/bun.svg?style=flat-square&color=b44e88)](https://github.com/caltechlibrary/bun/releases)
[![Python](https://img.shields.io/badge/Python-3.6+-brightgreen.svg?style=flat-square)](http://shields.io)
[![DOI](https://img.shields.io/badge/dynamic/json.svg?label=DOI&style=flat-square&color=lightgray&query=$.metadata.doi&uri=https://data.caltech.edu/api/record/2051)](https://data.caltech.edu/records/2051)
[![PyPI](https://img.shields.io/pypi/v/bun.svg?style=flat-square&color=orange)](https://pypi.org/project/bun/)
Table of contents
-----------------
* [Introduction](#introduction)
* [Installation](#installation)
* [Usage](#usage)
* [Known issues and limitations](#known-issues-and-limitations)
* [Getting help](#getting-help)
* [Contributing](#contributing)
* [License](#license)
* [Authors and history](#authors-and-history)
* [Acknowledgments](#authors-and-acknowledgments)
Introduction
------------
This 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 (_**B**asic **u**ser i**n**terface_) is the result. It provides functions such as `inform`, `warn`, `alert` and others, which you can use in code like this:
```python
if writable(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 as [Rich](https://rich.readthedocs.io/en/latest/) and [wxPython](https://wxpython.org) to provide simple high-level calls. Here is some sample output from an application that uses Bun:
<p align="center">
<img src="https://github.com/caltechlibrary/bun/raw/main/.graphics/cli-output-example.png">
</p>
Many user interface packages already exist for Python, but their use requires configuration and more complicated code to use. Bun aims to be simpler.
Installation
------------
The instructions below assume you have a Python interpreter installed on your computer; if that's not the case, please first [install Python version 3](INSTALL-Python3.md) and familiarize yourself with running Python programs on your system.
On **Linux**, **macOS**, and **Windows** operating systems, you should be able to install `bun` with [`pip`](https://pip.pypa.io/en/stable/installing/). To install `bun` from the [Python package repository (PyPI)](https://pypi.org), run the following command:
```
python3 -m pip install bun --upgrade
```
As an alternative to getting it from [PyPI](https://pypi.org), you can use `pip` to install `bun` directly from GitHub, like this:
```sh
python3 -m pip install git+https://github.com/caltechlibrary/bun.git --upgrade
```
Usage
-----
[_... forthcoming ..._]
Known issues and limitations
----------------------------
As 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 help
------------
If you find an issue, please submit it in [the GitHub issue tracker](https://github.com/caltechlibrary/bun/issues) for this repository.
Contributing
------------
We would be happy to receive your help and participation with enhancing Bun! Please visit the [guidelines for contributing](CONTRIBUTING.md) for some tips on getting started.
License
-------
Software produced by the Caltech Library is Copyright (C) 2020, Caltech. This software is freely distributed under a BSD/MIT type license. Please see the [LICENSE](LICENSE) file for more information.
Authors and history
---------------------------
I developed the first version of this code while implementing [Holdit](https://github.com/caltechlibrary/holdit). 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 (named `ui.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.
Acknowledgments
---------------
This work was funded by the California Institute of Technology Library.
The [vector artwork](https://thenounproject.com/term/bun/1979298/) of a bun, used as the icon for this repository, was created by [Vectors Market](https://thenounproject.com/vectorsmarket/) from the Noun Project. It is licensed under the Creative Commons [CC-BY 3.0](https://creativecommons.org/licenses/by/3.0/) license.
<div align="center">
<br>
<a href="https://www.caltech.edu">
<img width="100" height="100" src="https://raw.githubusercontent.com/caltechlibrary/bun/main/.graphics/caltech-round.png">
</a>
</div>
Raw data
{
"_id": null,
"home_page": "https://github.com/caltechlibrary/bun",
"name": "bun",
"maintainer": "",
"docs_url": null,
"requires_python": ">=3.6",
"maintainer_email": "",
"keywords": "Python,utilities,CLI,GUI,user interfaces",
"author": "Michael Hucka",
"author_email": "mhucka@caltech.edu",
"download_url": "https://files.pythonhosted.org/packages/84/33/f8b671a85df1b846bf7d8a0a9cb82d69f1f09daaaa2202831778d6bbc085/bun-0.0.8.tar.gz",
"platform": "",
"description": "Bun<img width=\"11%\" align=\"right\" src=\"https://github.com/caltechlibrary/bun/raw/main/.graphics/bun-icon.png\">\n===========================================================================\n\nBun (_**B**asic **u**ser i**n**terface_) is a small Python package for a basic user interface.\n\n[![License](https://img.shields.io/badge/License-BSD%203--Clause-blue.svg?style=flat-square)](https://choosealicense.com/licenses/bsd-3-clause)\n[![Latest release](https://img.shields.io/github/v/release/caltechlibrary/bun.svg?style=flat-square&color=b44e88)](https://github.com/caltechlibrary/bun/releases)\n[![Python](https://img.shields.io/badge/Python-3.6+-brightgreen.svg?style=flat-square)](http://shields.io)\n[![DOI](https://img.shields.io/badge/dynamic/json.svg?label=DOI&style=flat-square&color=lightgray&query=$.metadata.doi&uri=https://data.caltech.edu/api/record/2051)](https://data.caltech.edu/records/2051)\n[![PyPI](https://img.shields.io/pypi/v/bun.svg?style=flat-square&color=orange)](https://pypi.org/project/bun/)\n\nTable of contents\n-----------------\n\n* [Introduction](#introduction)\n* [Installation](#installation)\n* [Usage](#usage)\n* [Known issues and limitations](#known-issues-and-limitations)\n* [Getting help](#getting-help)\n* [Contributing](#contributing)\n* [License](#license)\n* [Authors and history](#authors-and-history)\n* [Acknowledgments](#authors-and-acknowledgments)\n\n\nIntroduction\n------------\n\nThis 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 (_**B**asic **u**ser i**n**terface_) is the result. It provides functions such as `inform`, `warn`, `alert` and others, which you can use in code like this:\n\n```python\nif writable(dest_dir):\n inform(f'Will write output to {dest_dir}.')\nelse:\n alert(f'Output destination {dest_dir} is not writable.')\n```\n\nBun 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 as [Rich](https://rich.readthedocs.io/en/latest/) and [wxPython](https://wxpython.org) to provide simple high-level calls. Here is some sample output from an application that uses Bun:\n\n<p align=\"center\">\n<img src=\"https://github.com/caltechlibrary/bun/raw/main/.graphics/cli-output-example.png\">\n</p>\n\nMany user interface packages already exist for Python, but their use requires configuration and more complicated code to use. Bun aims to be simpler. \n\n\nInstallation\n------------\n\nThe instructions below assume you have a Python interpreter installed on your computer; if that's not the case, please first [install Python version 3](INSTALL-Python3.md) and familiarize yourself with running Python programs on your system.\n\nOn **Linux**, **macOS**, and **Windows** operating systems, you should be able to install `bun` with [`pip`](https://pip.pypa.io/en/stable/installing/). To install `bun` from the [Python package repository (PyPI)](https://pypi.org), run the following command:\n```\npython3 -m pip install bun --upgrade\n```\n\nAs an alternative to getting it from [PyPI](https://pypi.org), you can use `pip` to install `bun` directly from GitHub, like this:\n```sh\npython3 -m pip install git+https://github.com/caltechlibrary/bun.git --upgrade\n```\n \n\nUsage\n-----\n\n[_... forthcoming ..._]\n\n\nKnown issues and limitations\n----------------------------\n\nAs 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`).\n\n\nGetting help\n------------\n\nIf you find an issue, please submit it in [the GitHub issue tracker](https://github.com/caltechlibrary/bun/issues) for this repository.\n\n\nContributing\n------------\n\nWe would be happy to receive your help and participation with enhancing Bun! Please visit the [guidelines for contributing](CONTRIBUTING.md) for some tips on getting started.\n\n\nLicense\n-------\n\nSoftware produced by the Caltech Library is Copyright (C) 2020, Caltech. This software is freely distributed under a BSD/MIT type license. Please see the [LICENSE](LICENSE) file for more information.\n\n\nAuthors and history\n---------------------------\n\nI developed the first version of this code while implementing [Holdit](https://github.com/caltechlibrary/holdit). 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 (named `ui.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.\n\n\nAcknowledgments\n---------------\n\nThis work was funded by the California Institute of Technology Library.\n\nThe [vector artwork](https://thenounproject.com/term/bun/1979298/) of a bun, used as the icon for this repository, was created by [Vectors Market](https://thenounproject.com/vectorsmarket/) from the Noun Project. It is licensed under the Creative Commons [CC-BY 3.0](https://creativecommons.org/licenses/by/3.0/) license.\n\n<div align=\"center\">\n <br>\n <a href=\"https://www.caltech.edu\">\n <img width=\"100\" height=\"100\" src=\"https://raw.githubusercontent.com/caltechlibrary/bun/main/.graphics/caltech-round.png\">\n </a>\n</div>\n\n\n",
"bugtrack_url": null,
"license": "BSD 3-clause",
"summary": "A Python package for a basic CLI and GUI user interface",
"version": "0.0.8",
"split_keywords": [
"python",
"utilities",
"cli",
"gui",
"user interfaces"
],
"urls": [
{
"comment_text": "",
"digests": {
"blake2b_256": "b0be9b62f8821bd48f8c1341e95dd73275fee7768beb739bcd67b10a39c62032",
"md5": "52e0dd770f4c4e3f42cda198f3336bc5",
"sha256": "c12d6305ae79f1ef95a3075238ae73ab11adfbc8b6e977a06a6793697e0ffd7b"
},
"downloads": -1,
"filename": "bun-0.0.8-py3-none-any.whl",
"has_sig": false,
"md5_digest": "52e0dd770f4c4e3f42cda198f3336bc5",
"packagetype": "bdist_wheel",
"python_version": "py3",
"requires_python": ">=3.6",
"size": 11851,
"upload_time": "2021-07-24T00:11:33",
"upload_time_iso_8601": "2021-07-24T00:11:33.519452Z",
"url": "https://files.pythonhosted.org/packages/b0/be/9b62f8821bd48f8c1341e95dd73275fee7768beb739bcd67b10a39c62032/bun-0.0.8-py3-none-any.whl",
"yanked": false,
"yanked_reason": null
},
{
"comment_text": "",
"digests": {
"blake2b_256": "8433f8b671a85df1b846bf7d8a0a9cb82d69f1f09daaaa2202831778d6bbc085",
"md5": "c1554de17a86c8fec6b3733289a974b0",
"sha256": "4953625b76c4b7990f51f11c7cd8275ac8f9b8932af7fe23a13c025a2969ed95"
},
"downloads": -1,
"filename": "bun-0.0.8.tar.gz",
"has_sig": false,
"md5_digest": "c1554de17a86c8fec6b3733289a974b0",
"packagetype": "sdist",
"python_version": "source",
"requires_python": ">=3.6",
"size": 12871,
"upload_time": "2021-07-24T00:11:35",
"upload_time_iso_8601": "2021-07-24T00:11:35.208783Z",
"url": "https://files.pythonhosted.org/packages/84/33/f8b671a85df1b846bf7d8a0a9cb82d69f1f09daaaa2202831778d6bbc085/bun-0.0.8.tar.gz",
"yanked": false,
"yanked_reason": null
}
],
"upload_time": "2021-07-24 00:11:35",
"github": true,
"gitlab": false,
"bitbucket": false,
"github_user": "caltechlibrary",
"github_project": "bun",
"travis_ci": false,
"coveralls": false,
"github_actions": true,
"requirements": [],
"lcname": "bun"
}