Arara rule for Pythontex

Based on an example from http://texwelt.de/wissen/fragen/4944/wie-kann-ich-arara-auf-das-nomentbl-paket-anwenden-um-ein-formelzeichenverzeichnis-zu-erstellen I managed to create a working version:

!config
# pythontex rule for arara
# author: Uwe Ziegenhagen
# requires arara 3.0+
identifier: pythontex
name: pythontex
command: <arara> pythontex @{options} "@{getBasename(file)}.pytxcode"
arguments: 
- identifier: style
  flag: <arara> @{parameters.style}
  default: pythontex
- identifier: options
  flag: <arara> @{parameters.options}

I have saved it under the name pythontex.yaml under <Drive>:\texlive\2016\texmf-dist\scripts\arara\rules, it seems to work as desired.


It proved actually to be not-so-hard to create basic working rule for PythonTeX in arara 5.1

pythontex.yaml

!config
# pythontex rule for arara
# author: Uwe Ziegenhagen, Tomas Krulis
# requires arara 5.0+
# According to: https://tex.stackexchange.com/questions/357881/arara-rule-for-pythontex
identifier: pythontex
name: pythontex
commands:
- name: PythonTeX and now for something completely different
  command: >
    @{
        return getCommand('pythontex', options, getBasename(reference))
     }
arguments:
- identifier: options
  flag: >
    @{
        if (isList(parameters.options)) {
            return parameters.options;
        }
        else {
            throwError('I was expecting a list of options.');
        }
    }