Skip to main content

A simple, yet capable configuration library for Python

Project description

pyfig

A Python configuration system that's powerful enough to meet complex requirements, while being simple enough so new contributors to your software can confidently make changes without worrying how to get everything setup.

Features

  • 📂 Hierarchical overrides
  • ✅ Validation powered by pydantic
  • 📝 Extensible templating for variables
  • 🛠️ Types, defaults, validation, and docs: all in one place directly in your code

Note: pyfig does not inherently support changes to the config at runtime. This feature is not planned.

Installation

pip install jpyfig

Requirements

Strictly, only pydantic is required.

To make full use of the all features, you may also need some of:

These can be independently installed as necessary.

Usage

  1. Install pyfig
  2. Create a class tree of subclasses of Pyfig (*). Provide all attributes, types, docs, and defaults in your .py's
  3. Create overriding configs that can be applied hierarchically based on your requirements
  4. Load your configuration:
    • Using either the built-in 'metaconf' feature, or
    • By creating your own implementation and calling pyfig.load_configuration(...) appropriately

Tutorial

There is a small tutorial ready to walk you through the features and patterns when using Pyfig. Click me

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

jpyfig-0.1.1.tar.gz (17.9 kB view hashes)

Uploaded Source

Built Distribution

jpyfig-0.1.1-py3-none-any.whl (26.4 kB view hashes)

Uploaded 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