configpy 0.5

Configuration file reading in Python made easy

  Add it to your Download Basket!

 Add it to your Watch List!

0/5

Rate it!
send us
an update
LICENSE TYPE:
The Apache License 2.0 
USER RATING:
UNRATED
  0.0/5
DEVELOPED BY:
John Keyes
HOMEPAGE:
keyes.ie
CATEGORY:
ROOT \ Utilities
configpy is a Python tool that makes reading configuration files very easy. With support for look-ahead and look-behind variable interpolation, native types such as int, float, dict and list configpy should satisfy your configuration file parsing needs.

Example:

from configpy import Config

cfg = """
nums = [1,2,3,4]
nando = "Nando"
names = ["Stevie", "${nando}", "Robbie"]
planets = { 'planet': '${red_planet}' }
red_planet = 'mars'
num_items = 5
item_cost = 1.99
"""

config = Config(cfg)
print sum(config.nums) # prints 10
print config.planets['planet'] # prints "mars"
config.names.sort()
print config.names # prints ["Nando", "Robbie", "Stevie"]
print config.num_items * config.item_cost # prints 9.95

Last updated on June 2nd, 2010

requirements

#read configuration #Python configuration #Python #configuration #reader #library

Add your review!

SUBMIT