Skip to main content
This is a pre-production deployment of Warehouse. Changes made here affect the production instance of PyPI (pypi.python.org).
Help us improve Python packaging - Donate today!

thedom is a collection of python objects that enable you to represent and interact with the DOM server side before generating HTML, CSS, and JavaScript for the client.

Project Description

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

Release History

Release History

This version
History Node

0.0.1

Supported By

WebFaction WebFaction Technical Writing Elastic Elastic Search Pingdom Pingdom Monitoring Dyn Dyn DNS Sentry Sentry Error Logging CloudAMQP CloudAMQP RabbitMQ Heroku Heroku PaaS Kabu Creative Kabu Creative UX & Design Fastly Fastly CDN DigiCert DigiCert EV Certificate Rackspace Rackspace Cloud Servers DreamHost DreamHost Log Hosting