Skip to main content
Join the official 2020 Python Developers SurveyStart the survey!

Process config file as a dict

Project description

What's it features

* as simple as others
* you can access options according to dict syntax, just like x['name']['o'] = 1,
x['name'].keys(), x['name'].values(), etc.
* you also can access options according to attr syntax, just like = 1,,, etc. So the name must be Identifier or single
* you can save comments in it(but this feature is not tested so much)
* support multi level section, subsection name will just like: [firsub/secsub]
* can save config items order
* support multi data types: string, unicode, int, float, list/tuple, dict, etc,
you can save them to or regain them from config file
* can convert to dict '''new'''
* auto detect BOM of utf-8 file '''new'''
* It's a little module, just for my mind, so if you like, you could try it, but
if you don't like, just skip it, that's ok

Where can I download it?

* Visit the site
* Project is in

What's new?
* 2012/10/14 Version 0.9.9 author:vicwjb {}
* Using 2to3 convert the source code
* Fix original str and unicode calls, remove unicode calls, and remove encoding processes
* Remove encrypt processes?
* Fix some syntax bugs, make it more pythonic
* If you want to use dict4ini in python3, you should import dict4ini3 module instead.

* 2011/11/08 Version 0.9.8

* Remove read file skip not exsisted judge, instead of raising Exception
* Add __enter__ and __exit__ to DictNode, thanks to yxj <381323646 AT>

* 2011/01/18 Version 0.9.7

* Fix #8 bug

* 2009/11/02 Version 0.9.6

* Add update method.

* 2008/03/14 Version 0.9.5

* Fix bug, and you can import dict4ini from dict4ini package

* 2008/02/16 Version

* Fix comment process, if you comment with node._comment, then if the comment
does not begin with '#'(commentdelimeter), it'll automatically add it.

* 2007/09/22 Version 0.9.3

* Improve the comment process
* Improve empty section process
* Add normal format support, so each value should be treated string type

* 2007/09/19 Version

* Save boolean value to 0 or 1
* Add iterator support, and you can use `for i in ini` to iterator (key,value)
* Add 'in' test support, so you can test if a key is in a ini via `key in
ini`, it's the same with `ini.has_key(key)`

* 2007/09/17 Version

* Fix the end string is \" bug

* 2007/08/08 Version

* Fix sub section bug, for secretSection argument, dict4ini will encrypt all
subsections of a secretSection, for example, secretSection=['a', 'c'], then all
subsections of 'a' and 'c' will be encrypted.
* Add missing file.

* 2007/07/09 Version thanks to Mayowa Akinyemi

* Add the ability to protect specific sections. When use with the secretKey or
hideData only section names listed in the secretSections parameter will be

* 2007/07/03 Version 0.9.2

* Add clear method
* Added encryption code thanks to Mayowa Akinyemi using the secretKey
parameter will encrypt the values using Paul Rubin's encryption module
using the hideData parameter will perform base64 enc/dec of the values

* 2007/06/26 Version 0.9.1

* Fix float convert bug

* 2007/06/13 Version 0.9

* Thanks for Victor Stinner giving a output format patch, so you can define
your own output format "%s = %s" to anything you want, for example "%s=%s" or
"%s:%s". And Dict4Ini will auto remove '%s' from the fromat string, and the
strip() the rest of the string, then use it to split the key and value in Ini
file. For example, if you using "%s:%", Dict4Ini will get "%s:%s".replace('%s',
'').strip(), then use ':' to split the line.

* 2007/04/20 Version 0.8

* Add exception process when parsing file
* Add BOM detect

* 2007/04/19 Version 0.7

* Fix '\' escape

* 2006/03/21 Version 0.6

* Fix ordereditems bug.

* 2006/01/04 Version 0.5

* 2006/01/04

* Add ordereditems() method, so you can get the items according the ini file

* 2005/12/30

* Support onelevel parameter, you can set it True, than only one level can
be used, so that the key can include section delimeter char in it.
* Support sectiondelimeter parmeter, you can set the section delimeter to
which you want

* 2005/12/12 Version 0.4

* Fixed a bug about "\" in option's value, thanks to Andreas Kaiser

* 2005/12/09 Version 0.3

* Adding dict() method, then you can change the DictIni object to dict type,
so you can really use it as a dict alternative

* 2005/10/16 Version 0.2

* Saving config items order
* Support float format

Project details

Supported by

Pingdom Pingdom Monitoring Google Google Object Storage and Download Analytics Sentry Sentry Error logging AWS AWS Cloud computing DataDog DataDog Monitoring Fastly Fastly CDN DigiCert DigiCert EV certificate StatusPage StatusPage Status page