pygenx

This is a Python wrapper for Genx, a simple C library for generating canonical XML. I use pyrex to generate the wrapper code, but the final distributable distutils source generated doesn't require pyrex.

For latest news and updates have a look at my blog. There is also a manual.

Example: Hello world

pygenx is pretty close to genx, with only the order of some of the arguments swapped to allow for defaults and keyword arguments in python. Here is the hello world sample:

#!/usr/bin/env python

import genx
import sys

#Equivalent to hello.c

writer = genx.Writer()
fp = sys.stdout
writer.startDocFile(fp)
writer.startElementLiteral("greeting")
writer.addText("Hello world!")
writer.endElement()
writer.endDocument()
      

And the output:

<greeting>Hello world!</greeting>
      

Documentation

Releases

pygenx pypi entry

0.6

This update represents a move to setuptools and darcs. I've simplified how I keep the source (since setuptools manages most of the pain nicely now). I've also squashed another major crasher issue, and added a simple dict based addAttributes method. Finally, I've also applied a patch to pyrex which should make it's generated code play better with gcc4 (Fedora in particular).

Files

pygenx-0.6.tar.gz
Install using python setup.py install

Older releases

These are the released tarballs for pygenx, the version numbering is pretty simple, 0.1 maps to genx beta 1, 0.2 to beta 2 and so on. This should give me the flexibility to have sub versions (e.g. if I screw up). I'll normally release at least two source tarballs, one is the python distutils source which builds with a plain python setup.py build and the other is a snapshot of the source taken from GNU arch. The latter is the actual source, from which I generate the distutils source package.

0.5.3

pygenx pypi entry

This is a fairly big update, it adds the manual and allows use of in memory buffers (like StringIO).

Files

pygenx-0.5.3.tar.gz
Install using python setup.py install
pygenx--releases--0.5.3--base-0.tar.gz
The original source I use to generate the distutils build.

0.5.2

This update fixes a horrible oversight on my part, I never tested to see if even basic UTF-8 gets handled properly. Since python keeps good track of string encodings, without any foo.encode("UTF-8") calls it assumes that the text going into genx was ASCII which caused encoding exceptions to be thrown when UTF-8 was thrown at it. I've added tests to catch this in future.

Files

pygenx-0.5.2.tar.gz
Install using python setup.py install
pygenx--releases--0.5.2.tar.gz
The original source I use to generate the distutils build.

0.5.1

pygenx pypi entry

This is simply a minor update with information in the setup.py file for Pypi (the python package index).

Files

pygenx-0.5.1.tar.gz
Install using python setup.py install
pygenx--releases--0.5.1.tar.gz
The original source I use to generate the distutils build. Get this if you want to make changes. Better still use GNU arch to check it out (see below).

0.5

This is the first release of pygenx which I can say will actually work for most people. It's based off beta 5 of genx, and has a complete test suite and all the functions should be wrapped (or at least those tested in the test suite).

Files

pygenx-0.5.tar.gz
Install using python setup.py install
pygenx--releases--0.5.tar.gz
The original source I use to generate the distutils build.

Older Files

pygenx--releases--0.3--base-0.tar.gz
This is a release of the 0.3 version, it builds and works under Mac OS X, but the distutils is broken (due to the gnarly optimisation problem in genx). I'm releasing this for completeness sake more than anything else. It's virtually there, being a full wrapper for the beta3 release of genx. It includes all the tests and a small amount of sample code. After this I'm updating to beta4 and hoping that the optimisation problem will be resolved in that or the next beta.
pygenx--mainline--0.1.tar.bz2
This is the initial release, with most of the basic functionality wrapped and some samples and tests. The build is scons based, and I haven't fully tested the distutils based build or whether it even works on anything other than my Mac :)

Source

The source is kept under darcs (http://www.darcs.net/). To grab it:

$ darcs get http://software.translucentcode.org/pygenx/darcs/pygenx

License

pygenx is licensed under the MIT License. See the LICENSE file.

Contact

Contact me via <mick nospamplease translucentcode.org> (usual feeble spam prevention tactic in my email address).