<jupyter_start><jupyter_text>Analysing Metrc DataBeginning work to analyse the JSON output of Metrc APIs (https://api-co.metrc.com).Let's start with something simple: count the number of items in the JSON document.<jupyter_code>import csv
import json

metrc_response_file = 'metrc_response.json'

metrc_items = []

with open(metrc_response_file, encoding='utf-8-sig') as mrf:
    mrf_text = mrf.read()
    for item in mrf_text:
        metrc_items.append(item[id]) 
    
print("There are", len(metrc_items), "Metrc items")<jupyter_output><empty_output>
{'fraction_non_alphanumeric': 0.10507246376811594, 'fraction_numerical': 0.0018115942028985507, 'mean_word_length': 5.144444444444445, 'pattern_counts': {'":': 0, '<': 5, '<?xml version=': 0, '>': 5, 'https://': 1, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'chain_length': '1', 'dir': 'jupyter-structured-clean-dedup', 'id': '199134', 'license': 'MIT', 'n_tokens_mistral': 196, 'n_tokens_neox': 190, 'n_words': 49, 'path': 'Untitled.ipynb', 'repo_name': 'MikeTheCanuck/Metrc-analysis', 'size': '552'}