Skip to main content

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 python 3 -m pip install conf-templater

Usage (standalone)

conf_templater --help

or

config_templater --help

Usage (python package)

  • Add conf-templater to requirements.txt.

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

from conf_templater import template_config


def run():
    template_config(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
python3 -m pip install -e .
  • Run for help
mypackage_config --help

Metadata

Release files for conf-templater 0.2.0

For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.

Built distribution (wheel)

Table of built distributions (wheels) for conf-templater 0.2.0
File Interpreter ABI Platform Actions
conf_templater-0.2.0-py3-none-any.whl Python 3 none any Details for conf_templater-0.2.0-py3-none-any.whl

Release files / conf_templater-0.2.0-py3-none-any.whl

Download URL conf_templater-0.2.0-py3-none-any.whl
Size 5.9 kB
Tags Python 3
SHA-256 checksum
How to use checksums
13be2c2e12a692df46a626f9a5928cbe3ec6f7f21abe80e7fe4830b89c55806f
BLAKE2b-256 checksum
How to use checksums
b4094fb13583346ca6399c67387d0de12544993dbc1f0e0d54dc506e04f60f8b
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via poetry/1.1.13 CPython/3.9.3 Linux/5.13.0-44-generic

Security for conf-templater 0.2.0

Provenance

Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.

No provenance found

None of the files in this release were uploaded with provenance metadata.

A note on package security

PyPI is a repository for distributing packages, not a service for auditing them. While third-party security researchers and our staff do their best to detect and remove malicious packages, PyPI cannot guarantee the quality, security or suitability of any given package.

To learn more about protecting yourself from malicious actors, visit our package security documentation.

Anthropic, PBC Visionary sponsor Bloomberg Visionary sponsor Hudson River Trading Visionary sponsor Meta Visionary sponsor NVIDIA Visionary sponsor Microsoft Sustainability sponsor Depot Continuous Integration AWS Cloud computing and Security Sponsor Datadog Monitoring Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page