<commit_before>"""
This module is a general example using test data showing usage of sparks, excel
and the studbook structure.
"""
import os

from GTT import SPARKS
from GTT import excel as ew
from GTT import studBookStruct

TEST_DIR = os.path.dirname(__file__)
TEST_DATA_DIR = os.path.join(TEST_DIR, 'testData')

# my_sparks_reader = SPARKS.SPARKSReader("test/testData/test_sparks_data.dbf")
moves_data = os.path.join(TEST_DATA_DIR, 'test_moves_data.dbf')
my_sparks_reader = SPARKS.SPARKSReader(moves_data)
my_excel_writer = ew.ExcelWriter("test/testData/test_excel_write.xlsx")

my_studbook = studBookStruct.Studbook()

my_studbook.add_header(my_sparks_reader.get_header_as_list())
my_studbook.add_records_from_list(my_sparks_reader.get_records_as_list())

my_excel_writer.write_studbook(my_studbook)
my_excel_writer.close()


<commit_msg>Use the correct excel path.<commit_after>"""
This module is a general example using test data showing usage of sparks, excel
and the studbook structure.
"""
import os

from GTT import SPARKS
from GTT import excel as ew
from GTT import studBookStruct

TEST_DIR = os.path.dirname(__file__)
TEST_DATA_DIR = os.path.join(TEST_DIR, 'testData')

# my_sparks_reader = SPARKS.SPARKSReader("test/testData/test_sparks_data.dbf")
moves_data = os.path.join(TEST_DATA_DIR, 'test_moves_data.dbf')
my_sparks_reader = SPARKS.SPARKSReader(moves_data)
excel_write = os.path.join(TEST_DATA_DIR, 'test_excel_write.xlsx')
my_excel_writer = ew.ExcelWriter(excel_write)

my_studbook = studBookStruct.Studbook()

my_studbook.add_header(my_sparks_reader.get_header_as_list())
my_studbook.add_records_from_list(my_sparks_reader.get_records_as_list())

my_excel_writer.write_studbook(my_studbook)
my_excel_writer.close()



{'fraction_non_alphanumeric': 0.09268854346574554, 'fraction_numerical': 0.0, 'mean_word_length': 7.603960396039604, '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': '7524749', 'n_tokens_mistral': 661, 'n_tokens_neox': 650, 'n_words': 117}