Skip to main content

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 action
  • default which is executed if no action is specified

Scope

Variables cascade via the following rules

  1. Built-in Actions (see src/ymm/builtin.yml)
  2. Environment variables (which are loaded at runtime)
  3. init
  4. prior actions
  5. current action

Control Characters

  1. '.' run this YMM action
  2. '$' run this in the shell
  3. '+' execute this Python string (use '"""' for docstrings)
  4. '^' pipe the prior result into this shell command
  5. '~' 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.

Release files for ymm 0.6.1

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

Source distribution (sdist)

Source distribution for ymm 0.6.1
File Size Uploaded
ymm-0.6.1.tar.gz 10.0 kB Details

Built distribution (wheel)

Table of built distributions (wheels) for ymm 0.6.1
File Interpreter ABI Platform
ymm-0.6.1-py3-none-any.whl Python 3 none any Details

Total release size: 16.7 kB

Release files / ymm-0.6.1.tar.gz

Download URL ymm-0.6.1.tar.gz
Size 10.0 kB
Tags Source
SHA-256 checksum
How to use checksums
11b8f49af8c60c51c006c83b133a7f8641feeb26d56e65e220770b76321ba2cb
BLAKE2b-256 checksum
How to use checksums
3d5fd53e3d213f3d4ba45863ea09cd4f711f948712fc3e6fb8a4a6ec50422a59
Upload date
Uploaded using Trusted Publishing?
What is 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

Release files / ymm-0.6.1-py3-none-any.whl

Download URL ymm-0.6.1-py3-none-any.whl
Size 6.7 kB
Tags Python 3
SHA-256 checksum
How to use checksums
c202e75156bec823de0477709b26b8013d053d9ff131acec7739bed54ca0f227
BLAKE2b-256 checksum
How to use checksums
88c9cc8b412317a85f1f5dc41c6bb37a51b1489df7e66808c6639ad6066502be
Upload date
Uploaded using Trusted Publishing?
What is 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
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