Personal data serialization modules

I finally managed to salvage my python work from my old hard drive, and these are the two modules I referred to in my previous post:

xmlValue

From that page:
This is a set of (two) modules which convert between a simple xml specification and nested Python dictionaries, making basic data easily writable and retrievable. The result is essentially very basic serialization that is language independent and human readable.
Again there are numerous serialization modules (Pickle, marshal, etc.), and I'm certain someone has made on that uses XML, however I was hoping to use these two that I've written (the data conversion is literally effortless). I know we're supposed to announce any personal libraries we plan to use far ahead of time, so if anyone has any qualms with these modules being used, I certainly won't complain. :)

(log in to comment)

Comments

That's all pretty simple stuff, so I have no problem with it. I'd like to see some usage documentation though :)

On a stylistic note, what's with the leading underscores in the function names?

The Python Style Guide gives the answer to that:
_single_leading_underscore: weak "internal use" indicator (e.g. "from M import *" does not import objects whose name starts with an underscore).
So it's an indicator for stuff that's not meant to be used from the outside.
Yeah, so I guess that leads me to my real question - why is that stuff marked as "internal use"? Why not expose those functions? They look useful - especially if you, say, want to embed the XML in some other XML (rather than be forced to write it to some file)

This is kinda a pet gripe for me. People marking stuff as "internal" are usually overly paranoid in my book :)

>>> import xmlValueWriter
>>> data = {}
>>> data['name'] = "Daniel Bickett"
>>> data['team'] = "heureusement"
>>> data['nestedDict'] = {'testing' : 1, 'blah': 4123}
>>> data['friends'] = {"Mac":"Graphics"}
>>> xmlValueWriter.write("entrant.xml", "Entrant", data)
Writing 'Entrant' to file 'entrant.xml'... Done!
Produces this: entrant.xml

Then...
>>> import xmlValueParser
>>> xmlValueParser.parse("entrant.xml")
: Loading xml value file: entrant.xml
{'nestedDict': {'blah': '4123', 'testing': '1'}, 'friends': {'Mac': 'Graphics'}, 'name': 'Daniel Bickett', 'team': 'heureusement'}
Obviously there are a few things that need to be fixed, now that I go through and use it again. There are output artifacts that need to be done away with. Also, it seems that in my MUD I never needed a boolean field (or else I was content with using '1' and '0' rather than creating a new feature for the module), so that hasn't been added :) Anyway, there it is, if it does need a bit of cleaning up.
using a personal serialization library from the past seems ok to me. it's not game-related enough nor unique enough to give a significant (unfair) advantage. just my 2 cents.