Machin is a cli program that simplifies file conversions and batch processing. It's inspired from filter/map/reduce
cargo install machinclone the project and install it with :
cargo install --path .Give the list of supported conversion for an entry format :
machmap -s svgConvert svg files to png, jpg :
ls *.svg | machmap -e png
ls *.svg | machmap -e jpgConvert webp files to png, jpg :
ls *.webp | machmap -e png
ls *.webp | machmap -e jpgConvert png files to jpg, pdf :
ls *.png | machmap -e jpg
ls *.png | machmap -e pdfConvert jpg files to png, pdf :
ls *.jpg | machmap -e png
ls *.jpg | machmap -e pdfConvert markdown files to html :
ls *.md | machmap -e htmlConvert json files to yaml :
ls *.json | machmap -e yamlConvert yaml files to json :
ls *.yaml | machmap -e jsonApply a grayscale, a vertical flip and at last a 90 degree rotation of photo.jpg to prefix_photo.jpg
Order is important :
- On first, color option
- flip option (vertical or horizontal)
- rotation
ls *.png | machconvert -c grayscale -f vertical -r 90 -p prefix_
ls *.jpg | machconvert -c grayscale -f vertical -r 90 -p prefix_Concatenate images on same file :
ls *.png | machreduce -o result.pngCreate pdf with images :
ls *.jpg | machreduce -o result.pdfCreate archive (zip) with files :
ls *.png | machreduce -o archive.zipCreate one pdf with multiple pdf :
ls *.pdf | machreduce -o merge.pdfOn zsh :
Add this on your ~/.zshrc :
fpath=("dir_of/_pouf" "${fpath[@]}")before :
autoload -Uz compinit && compinitMakefile inspired by https://git.sr.ht/~julienxx/castor/tree/master/item/Makefile
make cargo-publish