Skip to content

Commit f20959a

Browse files
committed
Fix mypy issues
1 parent 0e08040 commit f20959a

2 files changed

Lines changed: 7 additions & 3 deletions

File tree

src/fek_extractor/cli.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -210,7 +210,7 @@ def main() -> None:
210210
help="Emit only the Table of Contents as JSON (array of parts).",
211211
)
212212

213-
args = p.parse_args()
213+
args: argparse.Namespace = p.parse_args()
214214

215215
# Translate --debug into (debug: bool, debug_pages: Optional[int])
216216
if args.debug is None:

src/fek_extractor/core.py

Lines changed: 6 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -3,6 +3,7 @@
33

44
import re
55
from collections import OrderedDict
6+
from os import PathLike
67
from pathlib import Path
78
from typing import Any
89

@@ -16,9 +17,12 @@
1617
from .parsing.headers import parse_fek_header
1718
from .parsing.normalize import dehyphenate_text, normalize_text
1819

20+
# Convenience alias for public API
21+
Pathish = str | Path | PathLike[str]
22+
1923

2024
def extract_pdf_info(
21-
pdf_path: Path,
25+
pdf_path: Pathish,
2226
include_metrics: bool = False,
2327
**kwargs: Any,
2428
) -> dict[str, Any]:
@@ -99,7 +103,7 @@ def extract_pdf_info(
99103

100104

101105
def extract(
102-
input_path: Path,
106+
input_path: Pathish,
103107
include_metrics: bool = False,
104108
**kwargs: Any,
105109
) -> list[dict[str, Any]]:

0 commit comments

Comments
 (0)