<commit_before><commit_msg>Add loaddata json generator<commit_after>#!/usr/bin/env python

"""Print a loaddata-compatible JSON string for the Weight model."""

pts = \
    [ #("2015-02-15T10:10:00+10:00", 50.0, 20.0, 10)
    #, ("2015-02-16T10:11:00+10:00", 50.5, 20.1, 11)
    ]

fmt = r'''{
  "model": "weight.weight",
  "fields": {
    "time": "%s",
    "kg": %f,
    "body_fat": %f
  },
  "pk": %d
}'''

str_entries = [fmt % p for p in pts]

print('[')
print(',\n'.join(str_entries))
print(']')
{'fraction_non_alphanumeric': 0.2429718875502008, 'fraction_numerical': 0.10441767068273092, 'mean_word_length': 3.4954954954954953, 'pattern_counts': {'":': 6, '<': 3, '<?xml version=': 0, '>': 3, 'https://': 0, '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}}
{'dir': 'git-commits-cleaned', 'id': '3206449', 'n_tokens_mistral': 251, 'n_tokens_neox': 212, 'n_words': 46}