<commit_before>#!/usr/bin/env python3

import ethercalc
import os
import sys

cwd = os.path.dirname(os.path.realpath(sys.argv[0]))
ethercalc_dir = os.path.join(cwd, "ethercalc")
for i in os.listdir(ethercalc_dir):
    if i.endswith(".clc"):
        item = i.rsplit(".", maxsplit=1)[0]
        print(item)
    
<commit_msg>add body to install ethercalc<commit_after>#!/usr/bin/env python3

import ethercalc
import os
import sys
import requests

cwd = os.path.dirname(os.path.realpath(sys.argv[0]))
ethercalc_dir = os.path.join(cwd, "ethercalc")
ec = ethercalc.EtherCalc("http://localhost/calc/")
for i in os.listdir(ethercalc_dir):
    if i.endswith(".clc"):
        item = i.rsplit(".", maxsplit=1)[0]
        try:
            a = ec.export(i)
        except requests.exceptions.HTTPError:
            txt = open(os.path.join(ethercalc_dir, i))
            data = txt.read()
            print (data)
#            print (ec.update(item, data))


{'fraction_non_alphanumeric': 0.1504237288135593, 'fraction_numerical': 0.00847457627118644, 'mean_word_length': 2.9539748953974896, 'pattern_counts': {'":': 0, '<': 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': '3607396', 'n_tokens_mistral': 343, 'n_tokens_neox': 337, 'n_words': 68}