ππ¦ 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
Native
import refor regex;dp_*dotpath Β· activeit_*iteration Β·hs_*hashing Β·msg_*logging Β·gk_*validation Β·env_substhelpers require no imports. Deprecated helpers need legacy activation. -
π 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 '
import re
def transform(data, **_):
return [{**row, "ip": re.sub(r"\d+\.\d+$", "x.x", row["ip"])} for row 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 native
import re, 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
Active helper signatures, legacy activation and migration, pipeline controls,
args, andheaders. -
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 Pydantic's Rust implementation of a Python subset. Fimod pins Monty 1.0.0; this is not CPython or full standard-library parity.
- fimod is still pre-1.0. Supported mold APIs may evolve as the project matures.
- Versioning follows Semantic Versioning. Before 1.0, breaking changes bump the minor version; after 1.0, they 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.
- Fimod adds Rust helpers for dot paths, iteration, hashing, templating, logging, and validation. Legacy regex and selected iteration helpers require explicit activation; new regex molds use
import re.
Legacy built-ins
New molds use Monty's import re and Python deduplication/flattening code.
Existing molds can keep re_*, it_unique, it_unique_by, and it_flatten
by setting FIMOD_LEGACY_BUILTINS=1. No warning is emitted when enabled.
Without activation, calling one raises an error with migration guidance.
See the migration guide for API differences.