-
Notifications
You must be signed in to change notification settings - Fork 1
Expand file tree
/
Copy path__init__.py
More file actions
35 lines (27 loc) · 1.11 KB
/
__init__.py
File metadata and controls
35 lines (27 loc) · 1.11 KB
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
"""
This file is here, because this allows for best de-coupling of tests and application/library logic.
Further reading: https://docs.pytest.org/en/6.2.x/goodpractices.html#tests-outside-application-code
"""
from pathlib import Path
from typing import Dict, List
from docx import Document # type:ignore[import]
from docx.table import Table # type:ignore[import]
import ebddocx2table
def get_document(datafiles, filename: str) -> Document:
"""
a datafiles compatible wrapper around ebddocx2table.get_document
"""
path = datafiles / Path(filename)
return ebddocx2table.get_document(path)
def get_ebd_docx_tables(datafiles, filename: str, ebd_key: str) -> List[Table]:
"""
a datafiles compatible wrapper around ebddocx2table.get_ebd_docx_tables
"""
path = datafiles / Path(filename)
return ebddocx2table.get_ebd_docx_tables(path, ebd_key=ebd_key)
def get_all_ebd_keys(datafiles, filename: str) -> Dict[str, str]:
"""
a datafiles compatible wrapper around ebddocx2table.get_all_ebd_keys
"""
path = datafiles / Path(filename)
return ebddocx2table.get_all_ebd_keys(path)