[XML-SIG] [xml-dev] [ANN] Python XML Schema Bindings 1.0.0

Peter A. Bigot bigotp at acm.org
Thu Nov 19 23:45:42 CET 2009

Uche Ogbuji wrote:
> On Wed, Nov 18, 2009 at 5:01 PM, Peter A. Bigot <bigotp at acm.org 
> <mailto:bigotp at acm.org>> wrote:
>     PyXB version 1.0.0 is now available from SourceForge at:
>     http://sourceforge.net/projects/pyxb/
>     PyXB (Python XML Schema Bindings; "pixbee") is a pure Python
>     package that generates Python source code for classes that
>     correspond to data structures defined by XMLSchema.  In concept it
>     is similar to JAXB for Java and CodeSynthesis XSD for C++.  The
>     current release supports XML Schema 1.0.
> This looks like impressive work.
Thank you.
> I must say, though, aren't static-language-style data bindings rather 
> rigid, and counter to the spirit of Python?  Of course, I develop a 
> tool with a very different philosophy [1], but perhaps it's possible 
> to probe the matter with use-cases.
A dislike of static structures is certainly a prevalent view among 
Python aficionados, even those who tolerate XML.  I don't expect to get 
much attention from people who are building systems where they are in 
full control of both client and server implementation; many of those 
have no motivation to use XML at all, and would be better off using 
pickled data structures or JSON for data persistence and 
inter/intra-system communication.

The driving environment for PyXB's development is a community of 
engineers who use Python to compose applications from existing 
capabilities in multiple languages (primarily Fortran and C++).  The 
execution model and development environment of Java do not suit their 
culture.  They are being asked to publish interfaces to their systems in 
an enterprise-wide service-oriented architecture, and to make use of 
services provided by others.  The environment mandates an 
industry-supported standard for interfaces that can be accessed through 
a machine-readable service definition, rather than a vendor-provided 
language-specific library.  Java and C++ both have tools that support 
XML as a solution for this problem; Python has historically been less 

When operating with XML-based services that define their interfaces with 
schema, static bindings simplify both service provider and client.  In 
some cases it may be easy in Python to consume a service's XML without a 
binding, but to produce a document that is certain to conform to the 
service requirements can be quite a bit more effort.  This is especially 
true for complex descriptions like the Geography Markup Language.

For these situations, my hope is that PyXB will help eliminate the overt 
intrusion of XML into the code of an end user who really only wants to 
use (or provide) the service.  PyXB is only appropriate where an XML 
schema is already available or useful for other reasons.  That the 
current version nearly insists upon doing validation of input and output 
will make it unsuitable for some of those cases, though that's an issue 
that would be straightforward to address.


More information about the XML-SIG mailing list