QuickFig

Quick And Easy Python Config File Reader

Build Status Coverage Status PyPI version

QuickFig - Quick and Painless Config Parser for Python

A lightweight schema-supporting config parser for projects.

QuickFig Release Notes

Quick Intro to QuickFig

QuickFig is a quick and easy to use library for configuring your application using a Yaml file. QuickFig allows you to set up a loose schema with default values and data types that reduces error checking and config processing code in your app.

I have written something like this for almost every project I have done and it always take longer than it should, so I decided to write it as a library and share it.

Features

Usage

Concepts

Key concept in QuickFig is that while the config file can be netsted, it can always be flattended using the dotted notation - so that something like this:

    myapp:
        section_1:
           parameter: value
        section_2:
           parameter: another value

can also be represented as:

    myapp.section_1.parameter: value
    myapp.section_2.parameter: value

While the main config file can be in either format - the schema and overrides use the dotted notation

The goal is to make the config as seamless as possible to reduce validation and management code in your app.

Examples:

Full Example:

(This example exists in examples directory)

API:

Main Class: QuickFig()

This is the main class when using QuickFig.

QuickFig() Constructor
QuickFig() Instance Methods

Class: QuickFigNode()

This class appears similar to QuickFig, but is not instanciated directly. Instead it is created via section(name) method on either QuickFig() or QuickFigNode() instances)

QuickFigNode() Instance Methods