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.
Permalink
Type Name Latest commit message Commit time
Failed to load latest commit information.
requirements
static
tests
thedom
.coveragerc
.editorconfig
.env Add tests quicklink Oct 6, 2015
.gitignore
.travis.yml
AUTHORS
CHANGELOG.md
LICENSE
MANIFEST
README.md
logo.png
setup.py More renaming work Feb 10, 2014
tox.ini

README.md

thedom

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>
<html>
    <head>
    <title>
    </title>
    <meta content="text/html; charset=UTF-8" http-equiv="Content-Type">
    </meta>
    </head>
    <body>
        <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." />
                    </div>
                </div>
            </div>
        </div>
    </body>
</html>

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.