web developer & system programmer

coder . cl

ramblings and thoughts on programming...


pyxser-0.2 release candidate 1

published on 09-04-2009 / updated: 09-04-2009
posted in: programming, projects, python, pyxser
by Daniel Molina Wegener

I’ve released the version 0.2rc1 of pyxser my python-object xml serializer/deserializer. You can get more information about pyxser in the pyxser web page. In this release I’m expecting some user feedback, and I need some support on testing pyxser, run every debuger, profiler and memory profiler on it, and report me every bug that you know, thanks… ;)

The current ChangeLog for pyxser-0.2rc1 is:

0.2rc1 (2009.04.08):

        * Added serialize_c14n()
        * Added serialize_c14n_strict()
        * Added validate_c14n()
        * Added encodings support
        * Added serialization depth support



The current documentation for pyxser-0.2rc1 is as follows:

getdtd(...)
 This function returns the pyxser DTD location in your system as
 string

serialize(...)
 Uses the next keyword argumens:
    obj     ->      python object to serialize
    enc     ->      xml serialization encoding
    depth   ->      node navigation depth

 Gets any object defined in a Python module as class as argument
 and serializes it as XML. The serialization model is based on the
 pyxser DTD 1.0. Objects are serialized as pyxs:obj element, collections
 are serialized as pyxs:col element (tuples, lists and dictionaries)
 and properties are serialized as pyxs:prop elements.

 The serialization algorithm is a O(n) one, this means which the
 serializer runs over the object tree just one time and cross
 refernces are serialized as XML references through the IDREF
 attribute pyxs:ref.

 The serialization model resides in the pyxser public identifier DTD:
     <!DOCTYPE pyxs:obj
               PUBLIC '-//coder.cl//DTD pyxser 1.0//EN'
               'http://projects.coder.cl/pyxser/dtd/pyxser-1.0.dtd'>

serialize_c14n(...)
 Uses the next keyword argumens:
    obj     ->      python object to serialize
    depth   ->      node navigation depth
    exc     ->      exclusive canonization
    com     ->      with comments

 Same as serialize(), but uses C14N canonization, to use exclusive
 canonization the 'exc' argument must differ from zero and to use
 comments 'com' must differ from zero. The encoding must be UTF-8
 for canonization.

     <!DOCTYPE pyxs:obj
               PUBLIC '-//coder.cl//DTD pyxser C14N 1.0//EN'
               'http://projects.coder.cl/pyxser/dtd/pyxser-1.0-c14n.dtd'>

 * Information about Canonical XML at:

http://www.w3.org/TR/xml-c14n

 * Information about Exclusive Canonical XML at

http://www.w3.org/TR/xml-exc-c14n

 NOTE: The canonical DTD converts all ID, IDREF and NMTOKEN
       attributes to CDATA attributes

serialize_c14n_strict(...)
 Uses the next keyword argumens:
    obj     ->      python object to serialize
    depth   ->      node navigation depth
    exc     ->      exclusive canonization
    com     ->      with comments

 Same as serialize_c14n(), but uses C14N canonization in a strict
 mode and rather than serializing NMTOKEN, ID, and IDREF attributes,
 uses the C14N canon to execute the XML tree rendering. The encoding
 must be UTF-8 for canonization.

     <!DOCTYPE pyxs:obj
               PUBLIC '-//coder.cl//DTD pyxser C14N 1.0//EN'
               'http://projects.coder.cl/pyxser/dtd/pyxser-1.0.dtd'>

 * Information about Canonical XML at:

http://www.w3.org/TR/xml-c14n

 * Information about Exclusive Canonical XML at

http://www.w3.org/TR/xml-exc-c14n

 NOTE: C14N serialized objects can not be deserialized because we
       need the ID and IDREF attributes to suppor cross referenced
       objects.

unserialize(...)
 Uses the next keyword argumens:
    obj     ->      the serialized python object
    enc     ->      xml serialization encoding
 Takes an XML string as arguments to deserialize it and be converted
 back to it's original Python object. The deserialization algorithm
 supports automatic module loading, but searches for them in the module
 dictionary first to reach the original object type. It needs that the
 implied modules can be recheable by Python to get back the objects in
 it's original form.

 The deserialization algorithm is a O(n) one, this means that forward
 references are not supported because the first ocurrence of any object
 it's serialized once and then referenced, but not referenced and then
 serilized.

 Every serilized object is validated against the pyxser DTD 1.0

validate(...)
 Uses the next keyword argumens:
    obj     ->      the serialized python object
    enc     ->      xml serialization encoding

 Validates the XML input string against the pyxser DTD 1.0 in your
 local filesystem.

validate_c14n(...)
 Uses the next keyword argumens:
    obj     ->      the serialized python object
    enc     ->      xml serialization encoding

 Validates the XML input string against the pyxser DTD 1.0 C14N in
 your local filesystem.

xmlcleanup(...)
 Calls the cleanup function for the libxml2 parser, be carefull
 using this function, and try to use it when the parser really
 isn't in use.



Well, the pyxser skeleton is ready as it was thinked by me… thanks for testing and enjoy it ;)


one comment to “pyxser-0.2 release candidate 1”

  1. remember to create a friendly theme for mobile devices, such as this palm centro ;-)

post a comment

XHTML: You can use these tags: <a href="" title=""> <abbr title=""> <acronym title=""> <b> <blockquote cite=""> <cite> <code> <del datetime=""> <em> <i> <q cite=""> <strike> <strong>