-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathcomplexExample2.py
46 lines (32 loc) · 1.45 KB
/
complexExample2.py
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
from WaveFlow import PreRequisitesWave, To, DataHandler, Builder, Transmitter
class Request:
def __init__(self, filePath:str, filename:str, formatKey:list[str], zipFile, saveLocally):
self.filePath:str = filePath
self.filename:str = filename
self.formatKeys:list[str] = formatKey
self.zipFile:bool = zipFile
self.saveLocally:bool = saveLocally
request1 = Request(filePath=r'e.g\complex\doc.docx',
filename='D1/{} - Example 1',
formatKey=['NAME'],
zipFile= True,
saveLocally=True)
request2 = Request(filePath=r'e.g\complex\doc2.docx',
filename='D2/{} - {} - Example 2',
formatKey=['COUNTRY', 'NAME'],
zipFile= True,
saveLocally=True)
requestListage = [request1, request2]
handler = DataHandler(r'e.g\complex\bd.xlsx')
handler.getArchive().setDelimiter('==')
handler.readFile()
To.languageTo('pt_BR')
for request in requestListage:
handler.getArchive().transformData("HOUR", To.Hour().to_hh_mm)
handler.getArchive().transformData("DATE", lambda x: To.Date().to_personalizedFormat(x, '%d de %B de %Y'))
build = Builder(handler.getArchive(), request.filePath)
build.generate()
build.saveAs(textAtFile=request.filename,
keyColumn=request.formatKeys,
ZipFile=request.zipFile,
saveLocally=request.saveLocally)