-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathconfig.example.py
82 lines (74 loc) · 2.05 KB
/
config.example.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
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
# IMPORTS
# ---------------------------------------------------------------------------------------------------------------------
import os
import pandas as pd
# FUNCTIONS
# ----------------------------------------------------------------------------------------------------------------------
def custom_post_processing(df: pd.DataFrame) -> pd.DataFrame:
"""
Add code here to custom process columns
:param df:
:return:
"""
return df
def custom_report(df: pd.DataFrame) -> bool:
"""
Add code here to custom process columns
:param df:
:return:
"""
return True
# CONFIG
# ---------------------------------------------------------------------------------------------------------------------
IGNORE = """
*{keyword}*.xls[x|m|]
!.*
!._*
!~*
!Templates/
!Do not use/
"""
CONFIG = {
'data_set_name': 'PTP QC Planned Work',
'data_path': os.path.join(os.getcwd(), '../Exports/'),
'meta_range': 'E6:E6',
'file_config': dict(
root_path='/Volumes/Data/Temp/PTP2015/QC/',
file_filter=IGNORE.format(keyword='QC-Overall'),
file_path_pattern=r'^Week\s+(?P<week>\d+).+$',
period_from=None,
period_to=None,
post_processing=None,
unique_index=False,
),
'sheet_config': dict(
sheet_filter='Planned Work',
table_start_keyword='RECORD',
header_offset=1,
header_rows=1,
table_width=13,
),
'special': False,
'mappings': {
'columns': [
'EQ. ID.',
'DONE BY',
'PLANNED / SCHEDULED',
'U1',
'ACTUAL START',
'JOB / TASK DESCRIPTION',
'JOB STATUS',
'ACTUAL TIME COMPLETION',
'DOWNTIME (IN HOUR)',
'JOB CODE',
'WHARF MARK',
'REMARK',
'W. REQUEST & W. ORDER NO.',
],
'column_type_overrides': {
'DOWNTIME (IN HOUR)': 'float',
},
'custom_post_processing': custom_post_processing,
},
'report_function': custom_report,
}