#conversion #file #file-processing #batch #convert #cli-file #app

bin+lib machin

Machin is a cli program that simplifies file conversions and batch processing. It's inspired from filter/map/reduce

11 unstable releases

0.6.2 Sep 23, 2024
0.6.1 Aug 30, 2024
0.6.0 Nov 27, 2022
0.5.3 Aug 19, 2022
0.1.0 Jul 2, 2022

#1684 in Command line utilities

Download history 148/week @ 2024-09-18 56/week @ 2024-09-25 8/week @ 2024-10-02 9/week @ 2024-10-09 5/week @ 2024-10-16 1/week @ 2024-10-30 1/week @ 2024-11-06 6/week @ 2024-11-27 69/week @ 2024-12-04 67/week @ 2024-12-11 12/week @ 2024-12-18 6/week @ 2024-12-25 15/week @ 2025-01-01

130 downloads per month

Custom license

800KB
2K SLoC

Machin

LICENSE Build Status Coverage Status Crates.io Version Minimum rustc version

Intro

Machin is a cli program that simplifies file conversions and batch processing. It's inspired from filter/map/reduce

Last stable version

Packaging status

Install with crates.io

cargo install machin

Install on your system

clone the project and install it with :

cargo install --path .

Some machmap examples

Give the list of supported conversion for an entry format :

machmap -s svg

Convert svg files to png, jpg, avif or pdf :

ls *.svg | machmap -e png
ls *.svg | machmap -e jpg
ls *.svg | machmap -e avif
ls *.svg | machmap -e pdf

Convert webp files to png, jpg and avif :

ls *.webp | machmap -e png
ls *.webp | machmap -e avif
ls *.webp | machmap -e jpg

Convert png files to jpg, avif and pdf :

ls *.png | machmap -e jpg
ls *.png | machmap -e avif
ls *.png | machmap -e pdf

Convert jpg files to png, avif, pdf, odt :

ls *.jpg | machmap -e png
ls *.jpg | machmap -e avif
ls *.jpg | machmap -e pdf
ls *.jpg | machmap -e odt

Convert markdown files to html :

ls *.md | machmap -e html

Convert json files to yaml :

ls *.json | machmap -e yaml

Convert yaml files to json :

ls *.yaml | machmap -e json

Some machconvert examples

Apply a grayscale, a vertical flip and at last a 90 degree rotation of photo.jpg to prefix_photo.jpg

Order is important :

  1. On first, color option
  2. flip option (vertical or horizontal)
  3. rotation
ls *.png | machconvert -c grayscale -f vertical -r 90 -p prefix_
ls *.jpg | machconvert -c grayscale -f vertical -r 90 -p prefix_

Some machreduce examples

Concatenate images on same file :

ls *.png | machreduce -o result.png

Create pdf with images :

ls *.jpg | machreduce -o result.pdf

Create archive (zip) with files :

ls *.png | machreduce -o archive.zip

Create one pdf with multiple pdf :

ls *.pdf | machreduce -o merge.pdf

Autocomplete

On zsh :

Add this on your ~/.zshrc :

fpath=("dir_of/_pouf" "${fpath[@]}")

before :

autoload -Uz compinit && compinit

Dev

Makefile inspired by https://git.sr.ht/~julienxx/castor/tree/master/item/Makefile

Publish

make cargo-publish

Dependencies

~53MB
~804K SLoC