Skip to content
A python framework to generate html and JavaScript from reusable and combine-able widgets.
Branch: develop
Clone or download
Fetching latest commit…
Cannot retrieve the latest commit at this time.
Type Name Latest commit message Commit time
Failed to load latest commit information.
.env Add tests quicklink Oct 6, 2015
logo.png More renaming work Feb 10, 2014


PyPI version PyPi downloads Build Status License Bitdeli Badge

thedom is a collection of python objects that enable developers to generate and interact with web apps server side. It encourages object oriented website development, and code reuse by seperating each DOM element into its own object, and then allowing inheritance and child elements to come together to form new elements not defined in the standard DOM.

write this:

from thedom import layout, document, buttons

page = document.Document()
layout = page.addChildElement(layout.Center()).addChildElement(layout.Horizontal())
layout += buttons.Button(text="Use thedom.", **{'class':'MainAction'})
layout += buttons.Button(text="Enjoy writing less code.", **{'class':'DeleteAction'})
layout += buttons.Button(text="100% Python.")

print page.toHTML(formatted=True)

get this:

<!DOCTYPE html>
    <meta content="text/html; charset=UTF-8" http-equiv="Content-Type">
        <div class="WCenter">
            <div class="WOuter">
                <div class="WInner">
                    <div class="WClear">
                        <input class="WBlock WLeft MainAction" type="button" value="Use thedom." />
                        <input class="WBlock WLeft DeleteAction" type="button" value="Enjoy writing less code." />
                        <input class="WBlock WLeft" type="button" value="100% Python." />

Installing thedom

Installing thedom is as simple as:

pip install thedom

or if you prefer

easy_install thedom

Thanks and I hope you find thedom useful!

~Timothy Crosley

You can’t perform that action at this time.