This is the GruntWurk for Python Library — a practical, non-intrusive framework for desktop and (presumably) mobile apps.
By "non-intrusive," we mean that nothing is forced.
This library plays nice with other frameworks.
You are free to pick and choose the library elements that suit your needs and ignore the rest.
For example, you don’t have to use Python’s built-in argParser
library to process your command line interface, but if you do, then gwpycore
has helpers for that.
This library is divided into several sections:
Project site |
|
Issues |
|
Authors |
Craig Jones (polyglot-jones) |
License |
|
Python versions |
3.6 or above |
-
gwpycore
— Classes and functions that augment fundamental features of Python. ← You Are Here -
kivygw
— Extensions/helpers for the Kivy GUI framework. -
reportlabgw
— Extensions/helpers for the ReportLab PDF framework. -
general-tools
— BASH script tools/libraries for building Linux boxes (e.g. RaspberryPi boxes; virtual machines via Vagrant), a reference library of cheat sheets, and more. -
vscode-python
— a Visual Studio Code plugin with 100’s of commands and snippets for working with plain Python as well as these "GruntWurk for Python" enhancements. -
sublime_gruntwurk_python
— a SublimeText 4 plugin with commands and snippets for working with plain Python as well as these "GruntWurk for Python" enhancements.
The GruntWurk mission is to support open-source Python projects by making it easy for potential new contributors to jump on board. As the name implies, we aim to take the grunt-work out of project development, hiding away the complexities so that contributors can immediately get down to business. The shorter the learning curve, the easier it is for contributors to join in. See further details.
This gwpycore
package offers support for headless apps (command-Line only tools) as well as GUI apps (using the GUI framework of your choice).
-
Command-line support — building on the standard
argparse
library. -
Config file support — building on the standard
configparser
library. -
Advanced logging — building on the standard
logging
library. -
Advanced exception handling — with coordinated exit-code support.
-
Skin Asset Management (app color schemes)
-
Syntax Asset Management (syntax highlighting color schemes)
-
KeyMap Asset Management
-
Icon Asset Management (plus SVG colorizing support)
-
(Incubating) Font Asset Management
-
(Incubating) Image Asset Management
-
Abstract base classes for a simple in-memory "database" (a dictionary of objects that are persisted to disk as a text file, e.g. CSV or fixed field).
-
Classic Tree Structure (Nodes)
-
A
NamedColor
enum with 500+ standard colors and easy ways to manipulate them. (Works seamlessly with GWConfigParser.)
-
date_from_vague_parts()
-
interpret_date_range("YESTERDAY")
-
from_month_name()
-
timestamp()
— A simple string with the current date/time (e.g. to add it to a file name).
-
strip_blank_lines()
-
rstrip_special()
— A version of str.rstrip() that’s not as aggressive. -
leading_spaces_count()
— (Used by tab-to-spaces converter code, for example.) -
normalize_name()
— Replaces all non-alphanumeric characters with underscores.
-
fonts.py
— Installing a TTF or OTF font in Windows. -
winodws_behavior.py
—disableWindowTracking()
. -
winodws_printing.py
—view_pdf()
,print_pdf()
.
-
A standard set of dialog boxes (inform_user, ask_user_yes_no, …)
-
Theme support (skins, images, icons, keymaps, fonts, syntax)
-
Kivy Widgets
-
BackgroundColor — A composable widget that sets the background of another widget.
-
GWCamera — A subclass of Kivy’s Camera widget that is automatically configeured by our CameraInfo() singleton.
-
CropTool — A widget for zooming/panning/cropping an image.
-
EnumDropDown — A subclass of Kivy’s Spinner widget that is automatically populated by an enum class.
-
(Incubating) “Cookie-cutter” templates will be provided to jump-start your application projects.
Tip
|
In the mean time, see general_example.py in the examples folder.
|
Note
|
FYI, this gwpycore project itself, being a “library” as opposed to an “application,” was bootstrapped using pyscaffold.
|
See also our vscode-python
project and our sublime_grunwurk_python
project — plugins for Visual Studio Code and SublimeText, respectively.
Note
|
This library was developed in Python 3.8 on Windows 10. Everything should work in Python 3.6 and/or on non-Windows boxes, but no guarantees either way. |
-
The Gruntwork Mission — details.
-
Contributor code of conduct — common sense, but spelled out anyway.
For the User (App Developer):
-
Quick and easy: Getting your app to accept command-line switches.
-
Quick and easy: Getting your app to accept a basic configuration INI file.
-
Quick and easy: Writing a simple control panel app (i.e. a launcher platform).
-
Quick and easy: Taking advantage of Python’s Logging features.
-
Writing Filter Commands (command-line programs that are "piped" together).
-
Writing Apps with Exception Handling that combines logging and exit-code handling.
For any Possible Contributor to this Library: