Simple python module to generate configurations from templates
Project description
Config Templater
Simple python module to generate configurations from templates.
This is useful if you want to use configuration files for local development but want to use environment variables for deployment (i.e. in a container environment).
Free software: MIT license
Usage
You should run this script as a module. Executing in a directory will recursively parse the entire directory for .conftpl files and replace the jinja2 variables included with the corresponding environment variables.
Example
Given a configuration template file test.yml.conftpl like this:
---
access_token: "{{ API_ACCESS_TOKEN }}"
data_url: "{{ DATA_URL }}"
You can do the following to generate a configuration file:
# Set environment variables
$ export API_ACCESS_TOKEN="tdfkls0dkl1j313"
$ export DATA_URL="https://custome_domain.io/webhook"
$ python -m config_templater
This will generate the following configuration in test.yml
---
access_token: "tdfkls0dkl1j313"
data_url: "https://custome_domain.io/webhook"
Credits
This package was created with Cookiecutter and the audreyr/cookiecutter-pypackage project template.
History
0.1.0 (2019-12-10)
First release on PyPI.
Project details
Release history Release notifications | RSS feed
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.