This is a pre-production deployment of Warehouse. Changes made here affect the production instance of PyPI (
Help us improve Python packaging - Donate today!
Project Description

Generic code generator from WebIDL interfaces.

pywidl parses WebIDL code using PLY, builds the interface object model and emits
whatever code using user's mako templates or even user's native python module.

WebIDL object model
Defined in pywidl/

Common usage in tests/

Example usage

$ cat fragment.idl

exception GraphicsException {
DOMString reason;

interface Paint { };

interface SolidColor : Paint {
attribute float red;
attribute float green;
attribute float blue;

interface Pattern : Paint {
attribute DOMString imageURL;

interface GraphicalWindow {
readonly attribute unsigned long width;
readonly attribute unsigned long height;

attribute Paint currentPaint;

void drawRectangle(float x, float y, float width, float height);

void drawText(float x, float y, DOMString text);

$ cat mako.tpl

// ${foo}
% for definition in definitions:
% endfor

$ pywidl -m -o fragment.txt -t mako.tpl fragment.idl -- --foo=bar

$ cat fragment.txt

// bar

$ cat

def render(definitions=[], source=None, output=None,
template=None, template_type=None, foo=None, **kwargs):

with open(output, 'w') as out:
print >>out, "// %s" % foo
for definition in definitions:
print >>out,

pywidl -n -o fragment.txt -t native fragment.idl-- --foo=bar

$ cat fragment.txt

// bar
Release History

Release History


This version

History Node

TODO: Figure out how to actually get changelog content.

Changelog content for this version goes here.

Donec et mollis dolor. Praesent et diam eget libero egestas mattis sit amet vitae augue. Nam tincidunt congue enim, ut porta lorem lacinia consectetur. Donec ut libero sed arcu vehicula ultricies a non tortor. Lorem ipsum dolor sit amet, consectetur adipiscing elit.

Show More

Download Files

Download Files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

File Name & Checksum SHA256 Checksum Help Version File Type Upload Date
pywidl-0.1-py2.7.egg (53.6 kB) Copy SHA256 Checksum SHA256 2.7 Egg Mar 31, 2012
pywidl-0.1.tar.gz (18.9 kB) Copy SHA256 Checksum SHA256 Source Mar 31, 2012

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