jq ' [ .messages[] | {from, date} | select(.from != null) ] | group_by(.from) | map({ from: .[0].from, count: length, firstDate: (map(.date) | sort | .[0]) }) ' export.json >authors.json python3 output.py authors.json