From a07a0f6ee46e414f0dfdfcfafa592c92f9e30577 Mon Sep 17 00:00:00 2001 From: Nicolas Spalinger Date: Wed, 20 Mar 2024 11:22:03 -0500 Subject: [PATCH] Added some query examples using jq. --- contrib/jq-queries.txt | 25 +++++++++++++++++++++++++ 1 file changed, 25 insertions(+) create mode 100644 contrib/jq-queries.txt diff --git a/contrib/jq-queries.txt b/contrib/jq-queries.txt new file mode 100644 index 0000000..d3e1c2f --- /dev/null +++ b/contrib/jq-queries.txt @@ -0,0 +1,25 @@ + +jq is a json processor (https://jqlang.github.io/jq/) +Here are some possibly useful queries to run against families.json: + +Find all fonts which are redistributable (along with the download URL and the version): +jq 'map({family: .family, distributable: .distributable | select( . != false ), source: .source, packageurl: .packageurl, version: .version })' families.json + +Find all fonts which are not redistributable: +jq 'map({family: .family, distributable: .distributable | select( . != true ), source: .source})' families.json + +Find all fonts which are not released under the OFL: +jq 'map({family: .family, license: .license | select( . != "OFL" ), source: .source})' families.json + +Find all fonts which status is not current: +jq 'map({family: .family, status: .status | select( . != "current" ), source: .source})' families.json + +Find all fonts which have some sort of fallback: +jq 'map({family: .family, status: .status, fallback: .fallback})' families.json + + + +Get some numbers on the licensing landscape (using the miller filter from https://github.com/johnkerl/miller): +jq 'map({family: .family, license: .license, source: .source})' families.json | mlr --ijson --ocsv uniq -c -g license then sort -r count + +