ConfigParser shootout, preliminary entry

From: Michael Chermside (mcherm_at_mcherm.com)
Date: 10/18/04


Date: Sun, 17 Oct 2004 15:13:01 -0700
To: python-list@python.org

A few weeks ago, the suggestion was made on Python-Dev that it might be time
to consider replacing the ConfigParser module and that we should hold a
"shootout" (ie ask for implementations and see what we get).

Since then I've been playing around with this... not the parsing part (which
so far I have completely ignored) but the programmer interface. There needs
to be a well-thought-out data model for the information stored, and the user
interface needs to be very easy to use, yet not so "magical" that it becomes
difficult to understand.

I have put together what I think is probably my best proposal. It is based
on a superset of ini config files and java .property files. There is a
convenient access mechanism ("config.my_app.some_value") as well as more
general approaches ("config.values['my_app.serviceByPort.80']"). I have
tried to consider issues like unicode (I permit fairly lenient mixing of
unicode and str), and unit testing ("... call config.clear_all() in the
tearDown() method of any unittests that use the config module..."). I have
even considered carefully what to leave OUT (converting to non-string data
types, interpolating values, things like that).

I think that I am now at the point where I could really use some input from
others. So I'd like to invite people to review my design and send me your
suggestions. I'm not expecting this as a *useful* module yet (it doesn't
yet parse files!), but it seemed like a good stage at which to ask for
feedback. I'm attaching two files, config.py and configTest.py, and they
are also available from these urls:

    http://www.mcherm.com/publish/2004-10-17/config.py
    http://www.mcherm.com/publish/2004-10-17/configTest.py

Thanks in advance for reviewing this.

-- Michael Chermside



Relevant Pages

  • Re: ConfigParser shootout, preliminary entry
    ... > so far I have completely ignored) but the programmer interface. ... > tearDownmethod of any unittests that use the config module..."). ... So I'd like to invite people to review my design and send me your ...
    (comp.lang.python)
  • [ANN] ConfigObj 4.2.0
    ... config files in Python. ... Full unicode support added. ... It has lots of other features though. ... Integrated with a powerful validation system ...
    (comp.lang.python)
  • [ANN] ConfigObj 4.2.0
    ... config files in Python. ... Full unicode support added. ... It has lots of other features though. ... Integrated with a powerful validation system ...
    (comp.lang.python.announce)
  • Re: Future of FreeBSD 7.0 and up
    ... had me curious to asking this is this article I read about a review on ... "Installation of default config files. ... FreeBSD, nor us to read his/her articles:) ...
    (freebsd-questions)
  • Re: ConfigParser shootout, preliminary entry
    ... Config file reading is an area where python is 'well served' with ... Of course the obligatory URL ... > on a superset of ini config files and java .property files. ... So I'd like to invite people to review my design and send me your ...
    (comp.lang.python)