Skip to main content

Templater for app configuration files.

Project description

Config files templater

Package provides templating of mako-based templates of package config files.

Purpose

The main idea is, that config can be generated via console arguments of it`s required values. It is useful for deploy with configuration systems like ansible and others.

There is no more reason to keep config template itself separately from application (in deploy scripts/roles/whatever) or to define example with comments what config values require changing.

Besides that, package or program, as usual, is situated in system package directory (with config templates), that looks like one more problem during configuring.

Installation (standalone usage)

sudo -H pip install git+https://bitbucket.org/p-app/config_templater

Usage (standalone)

conf_templater --help

Usage (python package)

  • Add git+https://bitbucket.org/p-app/config_templater to requirements.txt.

  • Create cli script file, for example mypackage/scripts/config.py, that contains:

from conf_templater import run_config_templating


def run():
    run_config_templating(package='mypackage', subpath='config')


if __name__ == '__main__':
    run()
  • Create config file in package structure, for example mypackage/config/development.mako

  • Define entry point in setup.py file:

from setuptools import setup

setup(
    name='mypackage',
    install_requires=[
        'conf_templater'
    ],
    entry_points={
        'console_scripts': [
            'mypackage_config = mypackage.scripts.config:run'
        ]
    }
)
  • Run for development
pip install -e .
  • Run for help
mypackage_config --help

Compatibility

This package is python 2 and 3 both compatible.

Project details


Download files

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

Source Distributions

No source distribution files available for this release.See tutorial on generating distribution archives.

Built Distribution

conf_templater-0.2.0b1-py3-none-any.whl (5.8 kB view details)

Uploaded Python 3

File details

Details for the file conf_templater-0.2.0b1-py3-none-any.whl.

File metadata

  • Download URL: conf_templater-0.2.0b1-py3-none-any.whl
  • Upload date:
  • Size: 5.8 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: poetry/1.1.12 CPython/3.6.12 Linux/5.11.0-43-generic

File hashes

Hashes for conf_templater-0.2.0b1-py3-none-any.whl
Algorithm Hash digest
SHA256 e652e476111e8b179e43ff1d4133fd17c2291ee6bd51598d616f9f409badc78a
MD5 f62581af24285d1e9951e544c21503c6
BLAKE2b-256 d0877fc4720fbdc89ef3fd3a12a21b2eb554e9e2d77e1ed23e7b70515d160810

See more details on using hashes here.

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