Daniel is a web developer, system programmer and software architect with 12 years of experience...
web developer & system programmer
coder . cl
here you can find daniel's articles on programming, software development and ramblings on his current projects...
pyxser
|
Overview
pyxser stands for python xml serialization and is a python object to XML serializer that validates every XML deserialization against the pyxser 1.0 XML Schema. pyxser is written entirely in C as a python extension. The current stable release is pyxser-1.4.2r and supported Python version comes from 2.5 to 2.7. It uses an O(n) algorithm for serialization and other one of O(n) for deserialization, and both algorithms are recursive, but none of both are using arguments that could affect the stack, with a default max depth of 50 iterations.
Features
- Standards based serialization.
- Standards based XML validation.
- C14N based serialization, as optional kind of output.
- Model based XML serialization, represented on XML Schema and XML DTD.
Sample Output
Remember to download and save as XML and view with an XML editor.
Download
You can download pyxser from the sourceforge repository.
Related Documentation
- Pyxser, Serialización XML en Python (Spanish), a paper written in spanish which describes the pyxser serialization model and was to postulate to the JRSL’09 event in Chile.
- Pyxser, Serialización XML en Python (Spanish), a LaTeX Beamer presentation in spanish which describes the pyxser serialization model and was to postulate to the JRSL’09 event in Chile.
License
The pyxser license is GNU Lesser General Public License version 3. You can use in your closed source application, but if you modify pyxser, you must publish the changes.
Using pyxser
Using pyxser is a quiet simple:
### first import the extension from python source
import pyxser
# serialize an object
serialized = pyxser.serialize(obj = test, enc = "utf-8", depth = 0)
print "Serialized Object:\n" + serialized
# validate the object serialization
print "Serialized Object Validation:\n", pyxser.validate(serialized, enc = "utf-8")
# unserialize the object
unserialized = pyxser.unserialize(obj = serialized, enc = "utf-8")
# serialize using the C14N standard
serialized = pyxser.serialize_c14n(obj = test, depth = 0, exc = 0, com = 0)
print "Serialized Object:\n" + serialized
# validate the C14N serialization
print "Serialized Object Validation:\n", pyxser.validate_c14n(obj = serialized, enc = "utf-8")
# deserialize the C14N object
unserialized = pyxser.unserialize(obj = serialized, enc = "utf-8")
# use the C14N strict mode
serialized = pyxser.serialize_c14n_strict(obj = test, depth = 0, exc = 0, com = 0)
# cleanup the libxml2 parser
pyxser.xmlcleanup()
Project Costs and Statistics
The project statistics are as follows:
Donations
Support this project by donating through PayPal:
You need to log in to vote
The blog owner requires users to be logged in to be able to vote for this post.
Alternatively, if you do not have an account yet you can create one here.
Powered by Vote It Up

