Skip to content

fimod

πŸπŸ¦€ fimod

πŸ—οΈ Mold your data, shape your CI, play with your pipelines πŸͺΆ Python-powered molding without Python installed.

πŸ’‘ DRY your pipelines Β· Slim your container images Β· Tame your configs

fimod (Flexible Input, Mold Output Data) embeds Pydantic Monty (a Rust implementation of Python) in a single binary (~2.3 MB, UPX-compressed). You write the transform logic; fimod handles parsing, format detection, and I/O.

# 🎯 One-liner
fimod s -i data.json -e '[u for u in data if u["active"]]'

# πŸ“œ Reusable script
fimod s -i input.csv -m cleanup.py -o output.json

# πŸ”€ Format conversion
fimod s -i config.yaml -e 'data' -o config.toml

# πŸ”₯ Fetch from URLs β€” no curl, no wget, no pipes!
fimod s -i https://api.github.com/repos/pytgaen/fimod -e 'data["name"]' --output-format txt

✨ Features

  • Python you already know


    No new DSL. Write for, if, comprehensions, string methods β€” it's just Python.

  • Single binary


    No runtime, no pip install, no dependencies. One ~2.3 MB binary (UPX-compressed) that works everywhere.

  • All the formats


    JSON Β· NDJSON Β· YAML Β· TOML Β· CSV Β· TXT Β· Lines β€” auto-detected from extension.

  • Batteries included


    re_* regex Β· dp_* dotpath Β· it_* iteration Β· hs_* hashing Β· msg_* logging Β· gk_* validation Β· env_subst β€” no imports needed.

  • πŸš€ Awesome πŸ”₯ Your input can be an HTTPS request!


    Awesome: -i https://... just works β€” fimod fetches (via reqwest with proxy and HTTPS support), parses, and transforms in one shot. Goodbye curl | jq!


πŸ—ΊοΈ Guides

Start here if you're new to fimod.

  • Quick Start


    Install fimod and run your first transform in 2 minutes.

    Get started

  • Concepts


    The pipeline, Monty, molds, and the security model β€” how it all fits together.

    Understand fimod

  • Mold Scripting


    Write transforms with built-in regex, dotpath, iteration, and hash helpers.

    Write molds

  • CLI Reference


    All options and modes β€” slurp, check, no-input, in-place, args, debug, and more.

    Explore the CLI


πŸ“š Reference

Lookup tables and complete specifications.

  • Formats


    JSON, NDJSON, YAML, TOML, CSV, TXT, Lines β€” behavior and options for each.

    Formats

  • Built-ins


    Complete signatures for re_*, dp_*, it_*, hs_*, msg_*, gk_*, env_subst, set_exit, set_input_format, set_output_format, set_output_file, args, headers.

    Built-ins

  • Mold Defaults


    # fimod: directives β€” embed format and option defaults directly in scripts.

    Mold Defaults

  • Exit Codes


    --check truthiness table and set_exit behavior explained.

    Exit Codes


🍳 Cookbook

Practical recipes β€” filtering, aggregation, regex, format conversion, validation, data generation, slurp, and more.


⚠️ Project Status

Early-stage software

fimod is young software, built with AI-assisted development ("vibe coding").

  • Monty is an early-stage Rust implementation of Python by Pydantic. Its API is unstable and may introduce breaking changes.
  • fimod depends directly on Monty and inherits that instability. Expect breaking changes as both projects mature.
  • Versioning follows Semantic Versioning β€” breaking changes bump the major version.
  • Built-in helpers (re_*, dp_*, it_*, hs_*, msg_*, gk_*, env_subst) are implemented in Rust to complement Monty's limited stdlib. In particular, regex functions use fancy-regex syntax (Rust/PCRE2 flavour), not Python's re module β€” see Built-ins β†’ Regex.

Regex: Fimod built-ins vs Monty's re module

Fimod was originally built on Monty v0.0.6, which had no regex support. We introduced re_search, re_sub, re_findall, etc. as Fimod built-in functions to fill that gap β€” a good example of the challenges of moving fast alongside a young runtime.

Since Monty v0.0.8, import re works β€” Monty implements a subset of Python's re module. Both approaches now work side by side:

  • Fimod's re_* built-ins β€” direct access to fancy-regex, including advanced features like variable-length lookbehind/lookahead
  • import re β€” familiar Python API, but only partially implemented in Monty (also backed by fancy-regex under the hood)

The re_* built-ins are here to stay for the foreseeable future (at least until late 2027). As Monty's re module matures, we'll reconsider.

Since import re is already well-known to Python developers, the documentation focuses on the re_* built-ins which are specific to Fimod.