๐Ÿ“ฆ Colin-b / pyconfigparser

Python Configuration Parser (compatible python 2/3)

โ˜… 2 stars โ‘‚ 1 forks ๐Ÿ‘ 2 watching โš–๏ธ MIT License
ini-parserpython
๐Ÿ“ฅ Clone https://github.com/Colin-b/pyconfigparser.git
HTTPS git clone https://github.com/Colin-b/pyconfigparser.git
SSH git clone git@github.com:Colin-b/pyconfigparser.git
CLI gh repo clone Colin-b/pyconfigparser
Colin Bounouar Colin Bounouar Handle the fact that section does not exists 2d397e8 7 years ago ๐Ÿ“ History
๐Ÿ“‚ master View all commits โ†’
๐Ÿ“„ .gitignore
๐Ÿ“„ cfgparse.py
๐Ÿ“„ LICENSE
๐Ÿ“„ README.md
๐Ÿ“„ setup.py
๐Ÿ“„ README.md

pyconfigparser

Python Configuration Parser (compatible python 2/3)

Sample usage:

To read the following configuration file named configuration.ini:

[section] mandatory_property=mandatory value

You can use the following code:

import cfgparse

config = cfgparse.load_config('configuration.ini')
mandatory_value = cfgparse.get_item(config, 'section', 'mandatory_property')
optional_value = cfgparse.get_item(config, 'section', 'optional_property', 'default_value')