Skip to the content.



jc - JSON Convert git log command output streaming parser

This streaming parser outputs JSON Lines (cli) or returns an Iterable of Dictionaries (module)

Can be used with the following format options:

Additional options supported:

The epoch calculated timestamp field is naive. (i.e. based on the local time of the system the parser is run on)

The epoch_utc calculated timestamp field is timezone-aware and is only available if the timezone field is UTC.

Usage (cli):

$ git log | jc --git-log-s

Usage (module):

import jc

result = jc.parse('git_log_s', git_log_command_output.splitlines())
for item in result:
    # do something


  "commit":               string,
  "author":               string,
  "author_email":         string,
  "date":                 string,
  "epoch":                integer,  # [0]
  "epoch_utc":            integer,  # [1]
  "commit_by":            string,
  "commit_by_email":      string,
  "commit_by_date":       string,
  "message":              string,
  "stats" : {
    "files_changed":      integer,
    "insertions":         integer,
    "deletions":          integer,
    "files": [

  # below object only exists if using -qq or ignore_exceptions=True
  "_jc_meta": {
    "success":      boolean,     # false if error parsing
    "error":        string,      # exists if "success" is false
    "line":         string       # exists if "success" is false

[0] naive timestamp if "date" field is parsable, else null
[1] timezone aware timestamp availabe for UTC, else null


$ git log | jc --git-log-s


def parse(data: Iterable[str],
          raw: bool = False,
          quiet: bool = False,
          ignore_exceptions: bool = False) -> Union[Iterable[Dict], tuple]

Main text parsing generator function. Returns an iterable object.


data:              (iterable)  line-based text data to parse
                               (e.g. sys.stdin or str.splitlines())

raw:               (boolean)   unprocessed output if True
quiet:             (boolean)   suppress warning messages if True
ignore_exceptions: (boolean)   ignore parsing exceptions if True


Iterable of Dictionaries

Parser Information

Compatibility: linux, darwin, cygwin, win32, aix, freebsd

Version 1.2 by Kelly Brazil (