khufu ∞
Twitter Bootstrap elements via Python.
Documentation for khufu is hosted by Read the Docs ( development version and master version). The code lives on github. Please report any issues you find here.
Features ∞
Installation ∞
The easiest way to install khufu is to use pip
(here we show the install inside of a conda environment):
conda create -n khufu python=3.7 pip
conda activate khufu
pip install khufu
Or you can clone the github repo and install from a local version of the code:
git clone git@github.com:thespacedoctor/khufu.git
cd khufu
python setup.py install
To upgrade to the latest version of khufu use the command:
pip install khufu --upgrade
To check installation was successful run khufu -v
. This should return the version number of the install.
Development ∞
If you want to tinker with the code, then install in development mode. This means you can modify the code from your cloned repo:
git clone git@github.com:thespacedoctor/khufu.git
cd khufu
python setup.py develop
Pull requests are welcomed!
Initialisation ∞
Before using khufu you need to use the init
command to generate a user settings file. Running the following creates a yaml settings file in your home folder under ~/.config/khufu/khufu.yaml
:
khufu init
The file is initially populated with khufu’s default settings which can be adjusted to your preference.
If at any point the user settings file becomes corrupted or you just want to start afresh, simply trash the khufu.yaml
file and rerun khufu init
.
Modifying the Settings ∞
Once created, open the settings file in any text editor and make any modifications needed.
Basic Python Setup ∞
If you plan to use khufu
in your own scripts you will first need to parse your settings file and set up logging etc. One quick way to do this is to use the fundamentals
package to give you a logger, a settings dictionary and a database connection (if connection details given in settings file):
## SOME BASIC SETUP FOR LOGGING, SETTINGS ETC
from fundamentals import tools
from os.path import expanduser
home = expanduser("~")
settingsFile = home + "/.config/khufu/khufu.yaml"
su = tools(
arguments={"settingsFile": settingsFile},
docString=__doc__,
)
arguments, settings, log, dbConn = su.setup()
Todo List ∞
Todo
[ ] when complete, clean popover function
[ ] when complete add logging
[ ] when complete, decide whether to abstract function to another module
(The original entry is located in /home/docs/checkouts/readthedocs.org/user_builds/khufu/envs/master/lib/python3.7/site-packages/khufu-1.3.3-py3.7.egg/khufu/addons/popover.py:docstring of khufu.addons.popover.popover, line 22.)
Todo
[ ] when complete, clean popover function
[ ] when complete add logging
[ ] when complete, decide whether to abstract function to another module
(The original entry is located in /home/docs/checkouts/readthedocs.org/user_builds/khufu/envs/master/lib/python3.7/site-packages/khufu-1.3.3-py3.7.egg/khufu/addons/popover.py:docstring of khufu.addons.popover.popover, line 22.)
Todo
nice!
(The original entry is located in /home/docs/checkouts/readthedocs.org/user_builds/khufu/checkouts/master/docs/source/_template_.md, line 1.)
Release Notes ∞
v1.3.3 - May 10, 2022
FIXED doc fixes
v1.3.2 - December 3, 2020
fixed image wells not getting imported correctly
v1.3.1 - June 25, 2020
fixed small Python 2 to 3 issues
v1.3.0 - May 25, 2020
Now compatible with Python 3.*
API Reference ∞
Classes ∞
The worker class for the login_form module |
|
Framework for a bootstrap style well containing thumbnail images that can be clicked on to reveal a modal of more imformation |
|
An image and modal – click on the image to present the modal of the larger image with download options |
|
The worker class for the modalForm module |
|
The worker class for the login_page module |
|
The worker class for the sortable_table module |
Functions ∞
*Get close icon. |
|
Generate an abstract object style for building various types of components (like blog comments, Tweets, etc) that feature a left- or right-aligned image alongside textual content. |
|
popover to provide helper text or some secondary info about an element |
|
*Get well. |
|
Generate a button - TBS style |
|
Generate a buttonGroup - TBS style |
|
getpackagepath |
|
*get a toggleable, contextual menu for displaying lists of links. |
|
dropdownLinkList |
|
Generate a checkbox - TBS style |
|
generate a form row |
|
Generate a form - TBS style |
|
Generate a formActions - TBS style |
|
Generate a form input - TBS style |
|
Generate a horizontal form control group (row) - TBS style |
|
set a horizontal form label |
|
Generate a radio - TBS style |
|
Generate a search-form - TBS style |
|
Generate a select - TBS style |
|
Generate a textarea - TBS style |
|
Generate a uneditableInput - TBS style |
|
hide from device) |
|
Unescape a string previously escaped with cgi.escape() |
|
*Create an HTML image (with ot without link). |
|
Generate a thumbnail - TBS style |
|
Generate a thumbnail - TBS style |
|
Generate a alert - TBS style |
|
Generate a badge - TBS style |
|
Generate a label - TBS style |
|
Generate a progress bar - TBS style |
|
Generate a progress bar - TBS style |
|
generate a modal to by generated with a js event |
|
is navStyle active |
|
Generate a navBar - TBS style |
|
Create an html list of navigation items from the required python list |
|
*Generate pagination - TBS style. |
|
Create a twitter bootstrap responsive nav-bar component |
|
Create a Search box |
|
Generate a tabbable Navigation |
|
svg |
|
Generate an HTML body |
|
Get a column block for the Twiiter Bootstrap static layout grid. |
|
*Create a row using the Twitter Bootstrap static layout grid. |
|
Generate an html head element for your webpage |
|
The doctype and html tags |
|
row adjustable |
|
Generate a table - TBS style |
|
Generate a table caption - TBS style |
|
Generate a table body - TBS style |
|
Generate a table data cell - TBS style |
|
Generate a table header cell - TBS style |
|
Generate a table head - TBS style |
|
Generate a table row - TBS style |
|
Generate an anchor - TBS style |
|
Get HTML5 Abbreviation |
|
Get The HTML5 address element |
|
Get HTML5 Blockquote |
|
Colour text a given colour |
|
A list of definitions. |
|
Get HTML’s default emphasis tags with lightweight styles. |
|
Generate a heroUnit - TBS style |
|
Generate a li - TBS style |
|
An ordered list |
|
Get a Paragraph element |
|
Generate a pageHeader - TBS style |
|
Get An unordered list – can be used for navigation, stacked tab and pill |
|
default feilds |
A-Z Index ∞
Modules
Generate a code section |
|
common tools used throughout package |
|
Classes
The worker class for the login_form module |
|
Framework for a bootstrap style well containing thumbnail images that can be clicked on to reveal a modal of more imformation |
|
An image and modal – click on the image to present the modal of the larger image with download options |
|
The worker class for the modalForm module |
|
The worker class for the login_page module |
|
The worker class for the sortable_table module |
Functions
*Get close icon. |
|
Generate an abstract object style for building various types of components (like blog comments, Tweets, etc) that feature a left- or right-aligned image alongside textual content. |
|
popover to provide helper text or some secondary info about an element |
|
*Get well. |
|
Generate a button - TBS style |
|
Generate a buttonGroup - TBS style |
|
getpackagepath |
|
*get a toggleable, contextual menu for displaying lists of links. |
|
dropdownLinkList |
|
Generate a checkbox - TBS style |
|
generate a form row |
|
Generate a form - TBS style |
|
Generate a formActions - TBS style |
|
Generate a form input - TBS style |
|
Generate a horizontal form control group (row) - TBS style |
|
set a horizontal form label |
|
Generate a radio - TBS style |
|
Generate a search-form - TBS style |
|
Generate a select - TBS style |
|
Generate a textarea - TBS style |
|
Generate a uneditableInput - TBS style |
|
hide from device) |
|
Unescape a string previously escaped with cgi.escape() |
|
*Create an HTML image (with ot without link). |
|
Generate a thumbnail - TBS style |
|
Generate a thumbnail - TBS style |
|
Generate a alert - TBS style |
|
Generate a badge - TBS style |
|
Generate a label - TBS style |
|
Generate a progress bar - TBS style |
|
Generate a progress bar - TBS style |
|
generate a modal to by generated with a js event |
|
is navStyle active |
|
Generate a navBar - TBS style |
|
Create an html list of navigation items from the required python list |
|
*Generate pagination - TBS style. |
|
Create a twitter bootstrap responsive nav-bar component |
|
Create a Search box |
|
Generate a tabbable Navigation |
|
svg |
|
Generate an HTML body |
|
Get a column block for the Twiiter Bootstrap static layout grid. |
|
*Create a row using the Twitter Bootstrap static layout grid. |
|
Generate an html head element for your webpage |
|
The doctype and html tags |
|
row adjustable |
|
Generate a table - TBS style |
|
Generate a table caption - TBS style |
|
Generate a table body - TBS style |
|
Generate a table data cell - TBS style |
|
Generate a table header cell - TBS style |
|
Generate a table head - TBS style |
|
Generate a table row - TBS style |
|
Generate an anchor - TBS style |
|
Get HTML5 Abbreviation |
|
Get The HTML5 address element |
|
Get HTML5 Blockquote |
|
Colour text a given colour |
|
A list of definitions. |
|
Get HTML’s default emphasis tags with lightweight styles. |
|
Generate a heroUnit - TBS style |
|
Generate a li - TBS style |
|
An ordered list |
|
Get a Paragraph element |
|
Generate a pageHeader - TBS style |
|
Get An unordered list – can be used for navigation, stacked tab and pill |
|
default feilds |
Release Notes ∞
v1.3.3 - May 10, 2022
FIXED doc fixes
v1.3.2 - December 3, 2020
fixed image wells not getting imported correctly
v1.3.1 - June 25, 2020
fixed small Python 2 to 3 issues
v1.3.0 - May 25, 2020
Now compatible with Python 3.*