Commit 4db82b97 authored by Boris Baldassari's avatar Boris Baldassari
Browse files

Add script to export ort analyzer deps to dash.

parent 1433abdb
import json
import sys
import re
file_in = sys.argv[1]
if not file_in:
print('Need a file to work on.')
print(f'Usage: {sys.argv[0]} results.json')
#print(f"Reading results from {file_in}.")
with open(file_in, 'r') as f:
# parse file
results = json.loads(results_f)
npm_id_re = re.compile('^NPM:(?P<namespace>[^:]*):(?P<name>[^:]*):(?P<version>[^:]*)$')
#print(f"Found {len(results['analyzer']['result']['packages'])} packages.")
for i in results['analyzer']['result']['packages']:
# print(i['package']['id'])
npm_id_match = npm_id_re.match(i['package']['id'])
ns ='namespace') if'namespace') else '-'
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment