Composable Query Meta Language
Project description
ymm
YAML Mimics Makefiles
YMM is one of the first examples of YAAPL: YAML as a Programming Language
YMM uses standard YAML files with a few special conventions to function as a task runner. In addition to simply creating lists and dictionaries, YMM can execute commands (and thus return values) based on the 'control character' at the beginning of a line.
Getting Started
$ pip install ymm $ ymm --version
Data Structures
YMM files have a top-level dictionary, whose keys are called "actions."
Type $ ymm <action>
to execute and return the results of that action, which can be a dictionary or a list.
Dictionaries will set the results of that action to the key, which can be accessed as a {variable}
in future actions.
There are also two special actions:
init
which is always executed before any other actiondefault
which is executed if no action is specified
Scope
Variables cascade via the following rules
- Built-in Actions (see
src/ymm/builtin.yml
) - Environment variables (which are loaded at runtime)
- init
- prior actions
- current action
Control Characters
- '.' run this YMM action
- '$' run this in the shell
- '+' execute this Python string (use '"""' for docstrings)
- '^' pipe the prior result into this shell command
- '~' pipe the prior result into this jquery path
Motivation
Because I love YAML, and miss rake
.
I tried PyPyr, which is brilliant but painfully verbose.
I was going to write a preprocessor, then realized it was simpler to just execute the commands myself.
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.
Source Distribution
Built Distribution
File details
Details for the file ymm-0.6.1.tar.gz
.
File metadata
- Download URL: ymm-0.6.1.tar.gz
- Upload date:
- Size: 10.0 kB
- Tags: Source
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/3.8.0 pkginfo/1.8.2 readme-renderer/32.0 requests/2.27.1 requests-toolbelt/0.9.1 urllib3/1.26.8 tqdm/4.63.0 importlib-metadata/4.11.1 keyring/23.5.0 rfc3986/2.0.0 colorama/0.4.4 CPython/3.10.2
File hashes
Algorithm | Hash digest | |
---|---|---|
SHA256 | 11b8f49af8c60c51c006c83b133a7f8641feeb26d56e65e220770b76321ba2cb |
|
MD5 | 945f6bbcfe47eb5c7a0f2ed5eb1fdf0a |
|
BLAKE2b-256 | 3d5fd53e3d213f3d4ba45863ea09cd4f711f948712fc3e6fb8a4a6ec50422a59 |
File details
Details for the file ymm-0.6.1-py3-none-any.whl
.
File metadata
- Download URL: ymm-0.6.1-py3-none-any.whl
- Upload date:
- Size: 6.7 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/3.8.0 pkginfo/1.8.2 readme-renderer/32.0 requests/2.27.1 requests-toolbelt/0.9.1 urllib3/1.26.8 tqdm/4.63.0 importlib-metadata/4.11.1 keyring/23.5.0 rfc3986/2.0.0 colorama/0.4.4 CPython/3.10.2
File hashes
Algorithm | Hash digest | |
---|---|---|
SHA256 | c202e75156bec823de0477709b26b8013d053d9ff131acec7739bed54ca0f227 |
|
MD5 | 31cedf72a8ad3506221240194928ad92 |
|
BLAKE2b-256 | 88c9cc8b412317a85f1f5dc41c6bb37a51b1489df7e66808c6639ad6066502be |