I would like to allow the user of a progam I'm developing to create a pipeline of stages, probably separated by the | character (or a replacement). They would pass this text string to my program.
For example:
fred.txt | takeLines 5 | takeColumns 3 | makeHTML | fred.html
These are not the real stages and I probably haven't got the Unix file handling syntax quite right but bear with me, please.
Has anyone done this? And do you know of any modules that make it easy?
The pipeline is probably going to be invoked by:
1) Command line parameters when running (from the console?)
2) As part of an iOS extension.
I'm not sure if there are any gotchas or if I can get any help with parsing the stages.
I also can tweak the syntax. If I can't use | within the input string I could choose something else; I don't mind much.
One thing I'm sure of is I don't want to have the pipeline invoke multiple Pythonista programs. The data is too cumbersome to keep parsing and externalising at each stage. Or, put another way, it would introduce unnecessary inefficiency.
Thoughts?