Ejemplo n.º 1
0
def specaud():
    from datetime import date
    from pathlib import Path
    from pyexcelerate import Workbook
    from rfpack.validatabc import validatab
    from rfpack.customparamc import customparam
    from rfpack.pntopdc import pntopd
    from rfpack.graffullc import graffull
    from rfpack.csvfrmxlsxc import xlsxfmcsv
    proglabel2.config(text="")  # label init
    datab = Path('C:/SQLite/20200522_sqlite.db')
    pdf_file = date.today().strftime("%y%m%d") + '_Feat1ParAudit.pdf'
    pdf_path = datab.parent / pdf_file
    xls_file = Path(pdf_path.with_suffix('.xlsx'))
    wb = Workbook()  # pyexcelerate Workbook
    fndtbl = datab.parent / Path('findtable.csv')
    tbcstm = datab.parent / Path('tabcustom.csv')
    validatab(datab, fndtbl, tbcstm)  # locate input tab/parameters in dbabase
    pnglist, sheetsdic = customparam(datab, 'tab_par', 5, root, my_progress,
                                     proglabel2)  # generates png files
    # print Total info in 4 pages, 3 regions per page, bar starts at 60%
    pnglist1 = graffull(xls_file, 'Total', 4, 60, root, my_progress,
                        proglabel2)
    pnglist1.extend(pnglist)  # review png at the beginning
    pntopd(pdf_path, pnglist1, 50, 550, 500, 500)  # png to pdf
    xlsxfmcsv(xls_file, sheetsdic, 75, root, my_progress, proglabel2)
    my_progress[
        'value'] = 100  # prog bar increase a cording to i steps in loop
    proglabel2.config(text=my_progress['value'])
    response = messagebox.showinfo("Specific Audit", "Process Finished")
    proglabel3 = Label(root, text=response)
    my_progress['value'] = 0  # prog bar increase according to i steps in loop
    proglabel2.config(text="   ")
    root.update_idletasks()
Ejemplo n.º 2
0
                    #                         axis_text_y=element_text(color="grey", size=7),
                    #                         plot_title=element_text(size=25, face="bold"),
                    #                         axis_title=element_text(size=10),
                    #                         panel_spacing_x=0.6, panel_spacing_y=.45,
                    #                         # 2nd value number of rows and colunms
                    #                         figure_size=(5 * 4, 3.5 * 4)
                    #                         )
                    #     top_plot = (ggplot(data=toplot, mapping=aes(x='parameter', y='value')) + geom_boxplot() +
                    #                 geom_text(data=toplot1, mapping=aes(x='parameter', y='StdDev', label='concat'),
                    #                           color='red', va='top', ha='left', size=7, nudge_x=.6, nudge_y=-1.5) +
                    #                 facet_wrap('Prefijo') + custom_axis + scale_y_continuous(
                    #                 trans=asinh_trans) + ylab("Values") + xlab("Parameters") +
                    #                 labs(title="Top " + str(j + 1) + " Disc Parameter per Zone. " + cart) + coord_flip())
                    #     pngname = str(carr) + str(j + 1) + ".png"
                    #     pngfile = dat_dir / pngname
                    #     top_plot.save(pngfile, width=20, height=10, dpi=300)
                    #     pnglist.append(pngfile)
            except sqlite3.Error as error:  # sqlite error handling.
                print('SQLite error: %s' % (' '.join(error.args)))
                feedbk = tk.Label(top,
                                  text='SQLite error: %s' %
                                  (' '.join(error.args)))
                feedbk.pack()
    wb.save(xls_path)
    # pntopd(pdf_path, pnglist, 50, 550, 500, 500)
    c.close()
    conn.close()

validatab('C:/SQLite', '20200522_sqlite.db', 'findtable', 'tabcustom')
customparam('C:/SQLite', '20200522_sqlite.db', 'tab_par')
Ejemplo n.º 3
0
from rfpack.validatabc import validatab
from rfpack.customparamc import customparam
from rfpack.pntopdc import pntopd
from rfpack.get_sheet_detailsc import get_sheet_details
from rfpack.get_sheetid_bynamec import *
from rfpack.csvfrmxlsxc import csvfrmxlsx
from rfpack.graffullc import graffull
from rfpack.xlsxreordc import xlsxreord
from rfpack.csvfrmxlsxc import xlsxfmcsv

datab = Path('C:/SQLite/20200522_sqlite.db')
pdf_file = date.today().strftime("%y%m%d") + '_Feat1ParAudit.pdf'
pdf_path = datab.parent / pdf_file
xls_file = Path(pdf_path.with_suffix('.xlsx'))
wb = Workbook()  # pyexcelerate Workbook
validatab(datab, 'findtable',
          'tabcustom')  # locate input tab/parameters in dbabase
pnglist, sheetsdic = customparam(
    datab, 'tab_par')  # generates png files and create xlsx file
# rffl = 'C:/SQLite/tablasSQL.csv'  # sheets to select in xlsxsheets column
# rfflph = Path(rffl)
# clmntp = 'xlsxsheets'  # column to process in this case Total
# sheetsdic = get_sheet_details(xls_file)  # get sheet names and ids without opening xlsx file
# df = get_sheetid_bynamef(rfflph, clmntp, sheetsdic)  # xlsxsheets column from csv table file
# csvfrmxlsx(xls_file, df)  # df with sheets to be converted
pnglist1 = graffull(xls_file, 'Total',
                    4)  # print Total info in 4 pages, 3 regions per page
pnglist1.extend(pnglist)  # review png at the beggining
pntopd(pdf_path, pnglist1, 50, 550, 500, 500)  # png to pdf
xlsxfmcsv(xls_file, sheetsdic)
# xlsxreord(xls_file, df.at[0, 'name'], 0)  # put review sheet at the beginning of the file
Ejemplo n.º 4
0
from pathlib import Path
from pyexcelerate import Workbook
from rfpack.validatabc import validatab
from rfpack.customparamc import customparam
from rfpack.pntopdc import pntopd
from rfpack.graffullc import graffull
from rfpack.csvfrmxlsxc import xlsxfmcsv

datab = Path('C:/SQLite/20200522_sqlite.db')
pdf_file = date.today().strftime("%y%m%d") + '_Feat1ParAudit.pdf'
pdf_path = datab.parent / pdf_file
xls_file = Path(pdf_path.with_suffix('.xlsx'))
wb = Workbook()  # pyexcelerate Workbook
fndtbl = datab.parent / Path('findtable.csv')
tbcstm = datab.parent / Path('tabcustom.csv')
validatab(datab, fndtbl, tbcstm)  # locate input tab/parameters in dbabase
pnglist, sheetsdic = customparam(
    datab, 'tab_par')  # generates png files and create xlsx file
# rffl = 'C:/SQLite/tablasSQL.csv'  # sheets to select in xlsxsheets column
# rfflph = Path(rffl)
# clmntp = 'xlsxsheets'  # column to process in this case Total
# sheetsdic = get_sheet_details(xls_file)  # get sheet names and ids without opening xlsx file
# df = get_sheetid_bynamef(rfflph, clmntp, sheetsdic)  # xlsxsheets column from csv table file
# csvfrmxlsx(xls_file, df)  # df with sheets to be converted
pnglist1 = graffull(xls_file, 'Total',
                    4)  # print Total info in 4 pages, 3 regions per page
pnglist1.extend(pnglist)  # review png at the beggining
pntopd(pdf_path, pnglist1, 50, 550, 500, 500)  # png to pdf
xlsxfmcsv(xls_file, sheetsdic)
# xlsxreord(xls_file, df.at[0, 'name'], 0)  # put review sheet at the beginning of the file