properties

About properties

Properties is an implementation of java.util.Properties in Python. It may have some holes, but has been used in a couple projects with good results.

Notes

Requires Python 2.2 or greater because properties.Properties is a subclass of dict.

Examples

>>> from properties import Properties
>>> props = Properties()
>>> props['one'] = '1'
>>> props['your name'] = "I don't know"
>>> print '\n'.join(props.keys())
your name
one
>>> from StringIO import StringIO
>>> buff = StringIO()
>>> props.store(buff, "a little example...")
>>> buff.seek(0)
>>> print buff.read()
# a little example...
your\ name=I\ don\'t\ know
one=1
>>> print props['your name']
I don't know

License

Python License

Version History

Version 0.1.1 (2004-02-18)

  • Bug-fix for reading escaped property names (thanks to Lance Good!)

Version 0.1 (2002-04-20)

  • Initial release

Contact

Please feel free to contact me with questions, comments, or suggestions at oliver@rutherfurd.net.