项目作者: Microndgt

项目描述 :
Configuration for Humans
高级语言: Python
项目地址: git://github.com/Microndgt/pyconf.git
创建时间: 2018-04-08T03:08:26Z
项目社区:https://github.com/Microndgt/pyconf

开源协议:MIT License

下载


pyconf

Configuration for Humans in Python3.

pyconf is an INI/py/yml configuration parsing package, written for humans.

Installation

Install pyconf with pip:

  1. pip install git+https://github.com/Microndgt/pyconf.git

Usage

ini config file

  1. import pyconf
  2. c = pyconf.load('tests/sample.conf', config_class=pyconf.IniConfig)
  3. print(c['path'])
  4. # some_path

python config file

  1. import pyconf
  2. c = pyconf.load('tests/sample.py', config_class=pyconf.PyConfig)
  3. print(c['path'])
  4. # some_path

yaml config file

  1. import pyconf
  2. c = pyconf.load('tests/sample.yml', config_class=pyconf.YamlConfig)
  3. print(c['path'])
  4. # some_path

Tests

Run the tests with

  1. python -m tests.test_ini_configs
  2. python -m tests.test_py_configs
  3. python -m tests.test_yaml_configs

History

0.1.1

  1. support the yaml config file

0.1.0

  1. change the Architecture
  2. support the python config file

0.0.1

  1. init project
  2. ini config parser done