fx/doc/python.md
2022-05-10 21:39:34 +02:00

442 B

Python Reducers

If any additional arguments was passed, fx converts it to a function which takes the JSON as an argument named x.

export FX_LANG=python

Or

export FX_LANG=python3

Example:

fx data.json '[x["age"] + i for i in range(10)]'

Dot

Fx supports simple syntax for accessing data, which can be used with any FX_LANG.

$ echo '{"foo": [{"bar": "value"}]}' | fx .foo[0].bar
value