Skip to main content

A loader interface around multiple config file formats.

Project description

https://img.shields.io/pypi/v/plaster.svg https://img.shields.io/travis/mmerickel/plaster.svg Documentation Status

plaster is a loader interface around multiple config file formats. It exists to define a common API for applications to use when they wish to load configuration. The library itself does not aim to handle anything except a basic API that applications may use to find and load configuration settings. Any specific constraints should be implemented in a pluggable loader which can be registered via an entrypoint.

Usage

Applications should use plaster to load settings from named sections in a configuration source (usually a file).

Most applications will want to use plaster.get_settings(uri, section=None, defaults=None) to load the settings from a named section. It is possible to specify the section name in the uri itself via the uri#section syntax but it will be overridden by any explicit section parameter.

import plaster

settings = plaster.get_settings('development.ini#main')

Read the documentation for more information on using plaster in your application as well as how to create custom loaders.

Acknowledgments

This API is heavily inspired by conversations, contributions, and design put forth in https://github.com/inklesspen/montague and https://metaclassical.com/announcing-montague-the-new-way-to-configure-python-applications/.

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

plaster-0.2.tar.gz (19.4 kB view hashes)

Uploaded Source

Built Distribution

plaster-0.2-py2.py3-none-any.whl (7.4 kB view hashes)

Uploaded Python 2 Python 3

Supported by

AWS AWS Cloud computing and Security Sponsor Datadog Datadog Monitoring Fastly Fastly CDN Google Google Download Analytics Microsoft Microsoft PSF Sponsor Pingdom Pingdom Monitoring Sentry Sentry Error logging StatusPage StatusPage Status page