Skip to main content

whizkers

Mustache + YAML based config templater.

Sample usage

Installation

pip install whizkers

or just move whizkers.py to somewhere in your $PATH.

Dependencies

  • Python (2 or 3)

The below are Python libraries that should be installed via pip. Alternatively, if you did pip install whizkers, these should have been automatically installed.

  • argcomplete

  • colorlog

  • pystache

  • PyYAML

  • termcolor

  • watchdog

Autocomplete

sudo activate-global-python-argcomplete

If you installed via pip, you may need to run the following before autocompletion works:

grep 'PYTHON_ARGCOMPLETE_OK' "$(which whizkers)" &>/dev/null || sudo sed -i "1a # PYTHON_ARGCOMPLETE_OK" "$(which whizkers)"

Usage

usage: whizkers [-h] [-l] [-t TEMPLATE_DIR] [-d DEST_DIR] [-s VAR_SET_DIR]
                [-i IGNORES_FILE] [-e] [-w] [--watch-command WATCH_COMMAND]
                [--diff] [--dry]
                [variable_files [variable_files ...]]

A pystache + YAML based config templater.

Searches for an optional yaml file with a variable mapping in
~/.config/whizkers/variables.yaml,

an optional yaml file with an ignore scalar of regexes in (by default)
~/.config/whizkers/ignores.yaml,

and uses the mustache templates in (by default)
~/.config/whizkers/templates/

to render into your home directory (by default).

Additional variable files can be applied
by supplying them as arguments, in order of application.

They can either be paths or, if located in (by default)
~/.config/whizkers/variable_sets/,
extension-less filenames.

Environment variable support is available;
simply put the name of the variable in mustache brackets.

Order of precedence is:
last YAML variable defined >
first YAML variable defined >
environment variables.

Variables are shallowly resolved once, then anything in
{`...`} is eval'd in Python.

Autocomplete support available, but only for the default
variable set directory.

A file watcher is available via the -w flag.
Whenever a variable file in use, the ignores file,
or a template file changes, the templates are rendered
if there are any differences.

Diffs between the current destination files and
template renderings are available via the --diff flag.

positional arguments:
  variable_files        additional variable files

optional arguments:
  -h, --help            show this help message and exit
  -l                    list variable sets.
  -t TEMPLATE_DIR       template directory. Default:
                        /home/echan/.config/whizkers/templates
  -d DEST_DIR           destination directory. Default: /home/echan
  -s VAR_SET_DIR        variable set directory. Default:
                        /home/echan/.config/whizkers/variable_sets
  -i IGNORES_FILE       ignores file. Default:
                        /home/echan/.config/whizkers/ignores.yaml
  -e                    whether or not to use environment variables. Default:
                        don't use environment variables
  -w                    start file watcher.
  --watch-command WATCH_COMMAND
                        what to execute when a change occurs. Default: Nothing
  --diff                show diff between template renderings and current
                        destination files
  --dry                 do a dry run

Thanks to

Metadata

Release files for whizkers 1.1.0

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

Source distribution (sdist)

Source distribution for whizkers 1.1.0
File Size Uploaded Provenance Actions
whizkers-1.1.0.tar.gz 8.5 kB Without provenance Details for whizkers-1.1.0.tar.gz

Built distribution (wheel)

Table of built distributions (wheels) for whizkers 1.1.0
File Interpreter ABI Platform Actions
whizkers-1.1.0-py2.py3-none-any.whl Python 3, Python 2 none any Details for whizkers-1.1.0-py2.py3-none-any.whl

Total release size: 19.5 kB

Release files / whizkers-1.1.0.tar.gz

Download URL whizkers-1.1.0.tar.gz
Size 8.5 kB
Tags Source
SHA-256 checksum
How to use checksums
8c145956aea3be146f36311e64efdca9485de93f0cd32129ab21387b16204d5e
BLAKE2b-256 checksum
How to use checksums
32f7f34731bc052a2b8ac3e6aac1815116f0dc0942121aa863aab24c8e544852
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No

Release files / whizkers-1.1.0-py2.py3-none-any.whl

Download URL whizkers-1.1.0-py2.py3-none-any.whl
Size 11.0 kB
Tags Python 2 Python 3
SHA-256 checksum
How to use checksums
015e73888b10f2d7fc6b8bcad1b8469b87e44bf6866fb3c915464af12868ce11
BLAKE2b-256 checksum
How to use checksums
7aaab51c7a6a21d03675a6f5a0e302338b069d509a9adf1157f138cf7d5ef1cf
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No

Security for whizkers 1.1.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.

Release history Release notifications | RSS feed

This release

1.1.0 This release

2 release files No provenance

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