Skip to main content

Config as Framework

Project description

CAFRAM - Config as Framework

Cafram is a hierarchical configuration framework for Python. It provides classes to map a hierarchical configuration (usually loaded from YAML files) to Python objects. Then it provides a foundation to organize your application code.

Quickstart

On it's simplest form, it can load a simple yaml file and create a NodeObject:

import yaml
from cafram.nodes import ConfAuto

yaml_config = """
config:
  namespace: "my_ns"
  create_file: True
  backups: 3
  backup_prefix: null
files:
  - name: hello
  - name: world
filters:
  content:
    prepend: "Added at first"
    append: "Added at last"
  author:
    name: MyName
    date: True
"""

config = yaml.safe_load(yaml_config)

app = ConfAuto(ident="app", payload=config, autoconf=-1)
print ("List of files: ", app.files.get())
app.dump()

This is quite convenient, but it's quite useless.

Meta

Author: MrJK License: GPLv3

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

cafram-0.2.0a0.tar.gz (36.2 kB view hashes)

Uploaded Source

Built Distribution

cafram-0.2.0a0-py3-none-any.whl (42.3 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