jsonl-fstats is a Python3 program that extracts some statistics regarding field coverage in a line delimited JSON document.
It reads from stdin and prints to stdout.
jsonl-fstats.py
-h, --help show this help message and exit
-marc Ignore Marc Indicator
-help print more help
-headless don't print header
-len_val LEN_VAL specify the length for the values of "max-value" and "min-value"
-no_whitespace NO_WHITESPACE don't count values only including whitespaces
-delimiter DELIMITER delimiter to use
-csv-output prints the output as pure CSV data (all values are quoted)
- example with input and output file:
jsonl-fstats.py < [INPUT LINE-DELIMITED JSON DOCUMENT] > [OUTPUT STATISTICS DOCUMENT]
e.g.
apt-get install python3-numpy
- install numpy
- clone this git repo or just download the jsonl_fstats.py file
- run ./jsonl_fstats.py
- for a hackish way to use jsonl-fstats system-wide, copy to /usr/local/bin
- via pip:
(which provides you
sudo -H pip3 install --upgrade [ABSOLUTE PATH TO YOUR LOCAL GIT REPOSITORY OF JSONL-FSTATS]jsonl-fstatsas a system-wide commandline command)
(of the column headers of a resulting statistic)
- total record count of the input
- number of records that contain this field (path), i.e., field coverage
- total count of the occurrence of this field (path) over all records, i.e., an indicator for field where multiple values are allowed
- ^ percentage of 'existing'
- (existing / Total Records * 100)
- ^ percentage of 'notexisting'
- (not existing / Total Records * 100)
- number of records that do not contain this field (path)
- number of unique/distinct values of this field (path), i.e., cardinality
- average occurrence of a value/values of this field (path) over all records
- standard variation of a value/values of this field (path) over all records
- maximum count of a (unique/distinct) value of this field (path) over all records
- minimum count of a (unique/distinct) value of this field (path) over all records
- the concrete value of 'max', i.e., the most frequently used value
- the output is trimmed per default to max 17 character; you can change this string length with the option -var_len
- the concrete value of 'min', i.e., the least frequently used value
- the output is trimmed per default to max 17 character; you can change this string length with the option -var_len
- the number of characters of the longest string of this field (path)
- the number of characters of the shortest string of this field (path)
- the field (path) of this statistic line
Erklärung der Spaltenköpfe
- gibt an, über wieviele Rekords (=Zeilen) die Datei verfügt
- gibt an, wieviele Felder diesen Pfades existieren.
- gibt an, wieviele Werte diesen Pfades vorhanden sind. (Mehrfachbelegung)
- existing in Prozent
- existing / Total Records * 100
- notexisting in Prozent
- notexisting / Total Records * 100)
- gibt an, wieviele Rekords nicht über diesen Pfad verfügen
- gibt an, wieviele einzigartige Werte man in diesem Pfad findet
- gibt an, wie oft man im Schnitt einen Wert in diesem Pfad findet
- Standardabweichung der Häufigkeit der Werte in diesem Pfad
- Maximale Anzahl eines Wertes in diesem Pfad
- Minimale Anzahl eines Wertes in diesem Pfad
- Der Wert, welcher am häufigsten in diesem Pfad vorkommt
- Ausgabe ist auf 17 Stellen gekürzt, kann mit dem Schalter -var_len angepasst werden
- Der Wert, welcher am wenigsten in diesem Pfad vorkommt
- Ausgabe ist auf 17 Stellen gekürzt, kann mit dem Schalter -var_len angepasst werden
- Die Zeichenanzahl des längsten Wertes in diesem Pfad
- Die Zeichenanzahl des kürzesten Wertes in diesem Pfad
- Der Pfad zu den analysierten Werten