-
Notifications
You must be signed in to change notification settings - Fork 2
Expand file tree
/
Copy pathmffi_spider.py
More file actions
40 lines (30 loc) · 1013 Bytes
/
Copy pathmffi_spider.py
File metadata and controls
40 lines (30 loc) · 1013 Bytes
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
"""Legacy launcher for the original MFFI workbook workflow."""
from aromanexus.sources.mffi import MffiClient, create_chrome_driver
from aromanexus.workflows import run_mffi
INPUT_FILE = "max.xlsx"
COL_CAS = "CAS Number"
def init_driver():
return create_chrome_driver(headless=False)
def get_mffi_data(driver, cas: object) -> dict[str, object]:
result = MffiClient(driver=driver).lookup_cas(cas)
return result.values or {
"Chinese Name": "\\",
"English Name": "\\",
"Sensory Characteristics": "\\",
"In Water": "\\",
}
def main() -> None:
output = INPUT_FILE.replace(".xlsx", "_mffi_result.xlsx")
with MffiClient() as client:
summary = run_mffi(
INPUT_FILE,
client,
output_path=output,
cas_column=COL_CAS,
include_provenance=False,
checkpoint_every=10,
force=True,
)
print(f"Done: {summary.output_path}")
if __name__ == "__main__":
main()