khufu

https://img.shields.io/pypi/pyversions/khufu https://img.shields.io/pypi/v/khufu https://img.shields.io/github/license/thespacedoctor/khufu https://img.shields.io/pypi/dm/khufu

http://157.245.42.153:8080/buildStatus/icon?job=khufu%2Fmaster&subject=build%20master http://157.245.42.153:8080/buildStatus/icon?job=khufu%2Fdevelop&subject=build%20dev https://cdn.jsdelivr.net/gh/thespacedoctor/khufu@master/coverage.svg https://readthedocs.org/projects/khufu/badge/?version=master https://img.shields.io/github/issues/thespacedoctor/khufu/type:%20bug?label=bug%20issues

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

khufu.forms.login_form

The worker class for the login_form module

khufu.images.imageWell

Framework for a bootstrap style well containing thumbnail images that can be clicked on to reveal a modal of more imformation

khufu.images.imagingModal

An image and modal – click on the image to present the modal of the larger image with download options

khufu.modals.modalForm

The worker class for the modalForm module

khufu.scaffolding.login_page

The worker class for the login_page module

khufu.tables.sortable_table

The worker class for the sortable_table module

Functions

khufu.addons.closeIcon

*Get close icon.

khufu.addons.mediaObject

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.

khufu.addons.popover

popover to provide helper text or some secondary info about an element

khufu.addons.well

*Get well.

khufu.buttons.button

Generate a button - TBS style

khufu.buttons.buttonGroup

Generate a buttonGroup - TBS style

khufu.commonutils.getpackagepath

getpackagepath

khufu.dropdowns.dropdown

*get a toggleable, contextual menu for displaying lists of links.

khufu.dropdowns.dropdownLinkList

dropdownLinkList

khufu.forms.checkbox

Generate a checkbox - TBS style

khufu.forms.controlRow

generate a form row

khufu.forms.form

Generate a form - TBS style

khufu.forms.formActions

Generate a formActions - TBS style

khufu.forms.formInput

Generate a form input - TBS style

khufu.forms.horizontalFormControlGroup

Generate a horizontal form control group (row) - TBS style

khufu.forms.horizontalFormControlLabel

set a horizontal form label

khufu.forms.radio

Generate a radio - TBS style

khufu.forms.searchForm

Generate a search-form - TBS style

khufu.forms.select

Generate a select - TBS style

khufu.forms.textarea

Generate a textarea - TBS style

khufu.forms.uneditableInput

Generate a uneditableInput - TBS style

khufu.helpers.hide_from_device

hide from device)

khufu.helpers.unescape_html

Unescape a string previously escaped with cgi.escape()

khufu.images.image

*Create an HTML image (with ot without link).

khufu.images.thumbnail_div

Generate a thumbnail - TBS style

khufu.images.thumbnails

Generate a thumbnail - TBS style

khufu.labelsAndBadges.alert

Generate a alert - TBS style

khufu.labelsAndBadges.badge

Generate a badge - TBS style

khufu.labelsAndBadges.label

Generate a label - TBS style

khufu.labelsAndBadges.progressBar

Generate a progress bar - TBS style

khufu.labelsAndBadges.stackedProgressBar

Generate a progress bar - TBS style

khufu.modals.modal

generate a modal to by generated with a js event

khufu.navigation.is_navStyle_active

is navStyle active

khufu.navigation.navBar

Generate a navBar - TBS style

khufu.navigation.nav_list

Create an html list of navigation items from the required python list

khufu.navigation.pagination

*Generate pagination - TBS style.

khufu.navigation.responsive_navigation_bar

Create a twitter bootstrap responsive nav-bar component

khufu.navigation.searchbox

Create a Search box

khufu.navigation.tabbableNavigation

Generate a tabbable Navigation

khufu.plots.svg

svg

khufu.scaffolding.body

Generate an HTML body

khufu.scaffolding.grid_column

Get a column block for the Twiiter Bootstrap static layout grid.

khufu.scaffolding.grid_row

*Create a row using the Twitter Bootstrap static layout grid.

khufu.scaffolding.head

Generate an html head element for your webpage

khufu.scaffolding.htmlDocument

The doctype and html tags

khufu.scaffolding.row_adjustable

row adjustable

khufu.tables.table

Generate a table - TBS style

khufu.tables.tableCaption

Generate a table caption - TBS style

khufu.tables.tbody

Generate a table body - TBS style

khufu.tables.td

Generate a table data cell - TBS style

khufu.tables.th

Generate a table header cell - TBS style

khufu.tables.thead

Generate a table head - TBS style

khufu.tables.tr

Generate a table row - TBS style

khufu.typography.a

Generate an anchor - TBS style

khufu.typography.abbr

Get HTML5 Abbreviation

khufu.typography.address

Get The HTML5 address element

khufu.typography.blockquote

Get HTML5 Blockquote

khufu.typography.coloredText

Colour text a given colour

khufu.typography.descriptionLists

A list of definitions.

khufu.typography.emphasizeText

Get HTML’s default emphasis tags with lightweight styles.

khufu.typography.heroUnit

Generate a heroUnit - TBS style

khufu.typography.li

Generate a li - TBS style

khufu.typography.ol

An ordered list

khufu.typography.p

Get a Paragraph element

khufu.typography.pageHeader

Generate a pageHeader - TBS style

khufu.typography.ul

Get An unordered list – can be used for navigation, stacked tab and pill

khufu.urls.default_fields

default feilds

A-Z Index

Modules

khufu.addons

khufu.buttons

khufu.code

Generate a code section

khufu.commonutils

common tools used throughout package

khufu.dropdowns

khufu.forms

khufu.helpers

khufu.images

khufu.labelsAndBadges

khufu.modals

khufu.navigation

khufu.plots

khufu.scaffolding

khufu.tables

khufu.typography

khufu.urls

Classes

khufu.forms.login_form

The worker class for the login_form module

khufu.images.imageWell

Framework for a bootstrap style well containing thumbnail images that can be clicked on to reveal a modal of more imformation

khufu.images.imagingModal

An image and modal – click on the image to present the modal of the larger image with download options

khufu.modals.modalForm

The worker class for the modalForm module

khufu.scaffolding.login_page

The worker class for the login_page module

khufu.tables.sortable_table

The worker class for the sortable_table module

Functions

khufu.addons.closeIcon

*Get close icon.

khufu.addons.mediaObject

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.

khufu.addons.popover

popover to provide helper text or some secondary info about an element

khufu.addons.well

*Get well.

khufu.buttons.button

Generate a button - TBS style

khufu.buttons.buttonGroup

Generate a buttonGroup - TBS style

khufu.commonutils.getpackagepath

getpackagepath

khufu.dropdowns.dropdown

*get a toggleable, contextual menu for displaying lists of links.

khufu.dropdowns.dropdownLinkList

dropdownLinkList

khufu.forms.checkbox

Generate a checkbox - TBS style

khufu.forms.controlRow

generate a form row

khufu.forms.form

Generate a form - TBS style

khufu.forms.formActions

Generate a formActions - TBS style

khufu.forms.formInput

Generate a form input - TBS style

khufu.forms.horizontalFormControlGroup

Generate a horizontal form control group (row) - TBS style

khufu.forms.horizontalFormControlLabel

set a horizontal form label

khufu.forms.radio

Generate a radio - TBS style

khufu.forms.searchForm

Generate a search-form - TBS style

khufu.forms.select

Generate a select - TBS style

khufu.forms.textarea

Generate a textarea - TBS style

khufu.forms.uneditableInput

Generate a uneditableInput - TBS style

khufu.helpers.hide_from_device

hide from device)

khufu.helpers.unescape_html

Unescape a string previously escaped with cgi.escape()

khufu.images.image

*Create an HTML image (with ot without link).

khufu.images.thumbnail_div

Generate a thumbnail - TBS style

khufu.images.thumbnails

Generate a thumbnail - TBS style

khufu.labelsAndBadges.alert

Generate a alert - TBS style

khufu.labelsAndBadges.badge

Generate a badge - TBS style

khufu.labelsAndBadges.label

Generate a label - TBS style

khufu.labelsAndBadges.progressBar

Generate a progress bar - TBS style

khufu.labelsAndBadges.stackedProgressBar

Generate a progress bar - TBS style

khufu.modals.modal

generate a modal to by generated with a js event

khufu.navigation.is_navStyle_active

is navStyle active

khufu.navigation.navBar

Generate a navBar - TBS style

khufu.navigation.nav_list

Create an html list of navigation items from the required python list

khufu.navigation.pagination

*Generate pagination - TBS style.

khufu.navigation.responsive_navigation_bar

Create a twitter bootstrap responsive nav-bar component

khufu.navigation.searchbox

Create a Search box

khufu.navigation.tabbableNavigation

Generate a tabbable Navigation

khufu.plots.svg

svg

khufu.scaffolding.body

Generate an HTML body

khufu.scaffolding.grid_column

Get a column block for the Twiiter Bootstrap static layout grid.

khufu.scaffolding.grid_row

*Create a row using the Twitter Bootstrap static layout grid.

khufu.scaffolding.head

Generate an html head element for your webpage

khufu.scaffolding.htmlDocument

The doctype and html tags

khufu.scaffolding.row_adjustable

row adjustable

khufu.tables.table

Generate a table - TBS style

khufu.tables.tableCaption

Generate a table caption - TBS style

khufu.tables.tbody

Generate a table body - TBS style

khufu.tables.td

Generate a table data cell - TBS style

khufu.tables.th

Generate a table header cell - TBS style

khufu.tables.thead

Generate a table head - TBS style

khufu.tables.tr

Generate a table row - TBS style

khufu.typography.a

Generate an anchor - TBS style

khufu.typography.abbr

Get HTML5 Abbreviation

khufu.typography.address

Get The HTML5 address element

khufu.typography.blockquote

Get HTML5 Blockquote

khufu.typography.coloredText

Colour text a given colour

khufu.typography.descriptionLists

A list of definitions.

khufu.typography.emphasizeText

Get HTML’s default emphasis tags with lightweight styles.

khufu.typography.heroUnit

Generate a heroUnit - TBS style

khufu.typography.li

Generate a li - TBS style

khufu.typography.ol

An ordered list

khufu.typography.p

Get a Paragraph element

khufu.typography.pageHeader

Generate a pageHeader - TBS style

khufu.typography.ul

Get An unordered list – can be used for navigation, stacked tab and pill

khufu.urls.default_fields

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.*