skip to navigation
skip to content

cofman 0.1.0

COnfig File MANipluation library

Latest Version: Unknown

“manipulations and lies”

🚯 About

Manipulate simple configuration files in a, relatively, intelligent fashion.

Given a simple configuration file, cofman.lib provides a means to edit the file using a dictionary-like interface:

import cofman.lib

config = cofman.lib.File("/etc/sysctl.conf")
>>> config['kern.sysv.shmmin']
# given permission =)
>>> config['kern.sysv.shmmin'] = "100"

Every dictionary operation reads from the file, so using this as a cache is not appropriate. Usually, only the cofman.lib.File.update and cofman.lib.File.getset methods should be used to interact with the configuration. The other operations are provided for convenience.

By default, the configuration file is assumed to use the following delimiters:

config = {
        'quote': "'",
        'quote_escape': "''",
        'comment': "#",
        'assignment': '=',
        'record': '\n',


The value side of the settings are unconditionally quoted when modified.


cofman was not written with performance in mind. It is designed for common case editing that does not occur often enough to warrant heavy optimizations.

File Type Py Version Uploaded on Size
cofman-0.1.0.tar.gz (md5) Source 2012-08-28 9KB