Example #1
0
    def run(self):
        #getting a list of documents file name and its respective paths
        documents, documents_path = Invoice.get_files(self.path)
        print('Fetched files')

        #getting a list of word counts of the document
        wordcount = Invoice.all_file_wordcount(documents_path)
        print('Fetched word counts')

        #list of rounded off word counts
        dummy_count = Invoice.dummy_wordcount(wordcount)
        print('Fetched dummy count')

        #list of properties
        property_create, property_modified, property_title = Invoice.getProperties(
            documents_path)
        print('Fetched properties')

        #getting list of values
        property_values = Invoice.proper_properties(
            documents, property_title, property_create, property_modified,
            wordcount, dummy_count, self.title_bool, self.dummy_bool)
        print('Fetched proper properties')

        #fetch dictionary of data of properties
        data = Invoice.dictionary(property_values, self.title_bool,
                                  self.dummy_bool)
        print('Fetched Data')

        #drawing table
        table = Invoice.table(data)
        print('Table Drawn')

        #exporting the table to an excel file
        Invoice.export(table, self.file_path, self.filename)

        print('Invoice Saved')
Example #2
0
dummy = Invoice.dummy_wordcount(wordcount)
for i in range(len(dummy)):
    print(dummy[i])

c, m, t = Invoice.getProperties(files_path)
print('\n\nCreated:')
for i in range(len(c)):
    print(c[i])
print('\n\nModified')
for i in range(len(m)):
    print(m[i])
print('\n\nTitles:')
for i in range(len(t)):
    print(t[i])

properties = Invoice.proper_properties(files_name, t, c, m, wordcount, dummy,
                                       title_bool, dummy_bool)
print('\n\nValues without t and d')
for i in range(len(properties)):
    print(properties[i])

properties_t = Invoice.proper_properties(files_name, t, c, m, wordcount, dummy,
                                         title_bool, dummy_bool)
print('\n\nproper_properties with t')
for i in range(len(properties_t)):
    print(properties_t[i])

properties_d = Invoice.proper_properties(files_name, t, c, m, wordcount, dummy,
                                         title_bool, dummy_bool)
print('\n\nvalues with d')
for i in range(len(properties_d)):
    print(properties_d[i])