ππ¦ fimod β the data shaper CLI
ποΈ 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 (~3.3 MB in the UPX-compressed standard build). You write the transform logic; fimod handles parsing, format detection, and I/O.
Python syntax, Monty runtime
Fimod runs molds on Monty, not CPython: use familiar Python syntax and built-ins, with Rust-powered helpers for data shaping.
# π― 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, and string methods using Monty's Python subset. -
Single binary
No runtime, no
pip install, no dependencies. One ~3.3 MB standard binary after UPX compression; useslimwhen you do not need HTTP input, orfimod-fastfor large CPU-heavy runs. -
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 (viareqwestwith proxy and HTTPS support), parses, and transforms in one shot. Goodbyecurl | jq!
π A taste of what fimod can do
π Python-syntax transforms β Rust-powered I/O, serialization & builtins:
# YAML to JSON, filter active users, sort by name
fimod s -i users.yaml -e '[u for u in data if u["active"]]' -e 'it_sort_by(data, "name")' -o result.json
# Filter active users, then group by role β Unix pipes just work
fimod s -i users.json -e '[u for u in data if u["active"]]' | fimod s -e 'it_group_by(data, "role")'
# Enrich records with Python string methods β try this in jq...
fimod s -i users.json -e '[{**u, "slug": u["name"].lower().replace(" ", "-"), "domain": u["email"].split("@")[1]} for u in data]'
π¦ Registry molds β reusable recipes, one @name away:
# π Patch a YAML config with dot-path assignments
fimod s -i deployment.yaml -m @yaml_merge --arg set="spec.replicas=3,metadata.labels.env=prod" -o deployment.yaml
# π Anonymize PII fields with SHA-256
fimod s -i users.json -m @anonymize_pii --arg fields=email,phone -o users_anon.json
π¦ More molds in the fimod-powered registry:
| Mold | Description |
|---|---|
@gh_latest |
GitHub release resolver |
@download |
wget-like fetch |
@poetry_migrate |
Poetry β uv/Poetry 2 |
@skylos_to_gitlab |
dead code β GitLab Code Quality |
πΏ Even more taste... (in-place, regex, log parsing, env templating)
# π Anonymize emails in-place β replace with SHA-256 hashes
fimod s -i customers.csv -e '[{**r, "email": hs_sha256(r["email"])} for r in data]' --in-place
# π΅οΈ Mask IPs with regex β 192.168.1.42 β 192.168.x.x
fimod s -i logs.json -e '[{**r, "ip": re_sub(r"\d+\.\d+$", "x.x", r["ip"])} for r in data]'
Run fimod mold list to browse all built-in molds.
πΊοΈ Guides
Start here if you're new to fimod.
-
Quick Start
Install fimod and run your first transform in 2 minutes.
-
Concepts
The pipeline, Monty, molds, and the security model β how it all fits together.
-
Mold Scripting
Write transforms with built-in regex, dotpath, iteration, and hash helpers.
-
CLI Reference
All options and modes β slurp, check, no-input, in-place, args, debug, and more.
π Reference
Lookup tables and complete specifications.
-
Formats
JSON, NDJSON, YAML, TOML, CSV, TXT, Lines β behavior and options for each.
-
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. -
Mold Defaults
# fimod:directives β embed format and option defaults directly in scripts. -
Exit Codes
--checktruthiness table andset_exitbehavior explained.
π³ 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. It is not CPython, and its API 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.
- Mold scripts can use Python syntax, common built-ins, and selected stdlib modules, but not arbitrary PyPI packages or full stdlib parity.
- Built-in helpers (
re_*,dp_*,it_*,hs_*,tpl_*,msg_*,gk_*,env_subst) are implemented in Rust as part of fimod's data-shaping API. In particular, regex functions use fancy-regex syntax (Rust/PCRE2 flavour), not Python'sremodule β 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.