Skip to content

Commit 41f7ab4

Browse files
committed
Make mypy happy and fix README anchors
1 parent f20959a commit 41f7ab4

2 files changed

Lines changed: 20 additions & 17 deletions

File tree

README.md

Lines changed: 16 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -86,22 +86,22 @@ With this mix, FEK PDFs become consistent, navigable JSON/CSV with reliable meta
8686
## Table of contents
8787

8888
- [Demo \& screenshots](#demo--screenshots)
89-
- [Requirements](#-requirements)
90-
- [Install](#-install)
91-
- [Quickstart](#-quickstart)
92-
- [CLI usage](#-cli-usage)
93-
- [Python API](#-python-api)
94-
- [Output schema](#-output-schema)
95-
- [Technical deep dive](#-technical-deep-dive)
96-
- [Architecture](#-architecture)
97-
- [Examples](#-examples)
98-
- [Debug helpers](#-debug-helpers)
99-
- [Performance tips](#-performance-tips)
100-
- [Project layout](#-project-layout)
101-
- [Development](#-development)
102-
- [Contributing](#-contributing)
103-
- [License](#-license)
104-
- [Contact](#-contact)
89+
- [Requirements](#requirements)
90+
- [Install](#install)
91+
- [Quickstart](#quickstart)
92+
- [CLI usage](#cli-usage)
93+
- [Python API](#python-api)
94+
- [Output schema](#output-schema)
95+
- [Technical deep dive](#technical-deep-dive)
96+
- [Architecture](#architecture)
97+
- [Examples](#examples)
98+
- [Debug helpers](#debug-helpers)
99+
- [Performance tips](#performance-tips)
100+
- [Project layout](#project-layout)
101+
- [Development](#development)
102+
- [Contributing](#contributing)
103+
- [License](#license)
104+
- [Contact](#contact)
105105

106106
---
107107

src/fek_extractor/core.py

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -30,6 +30,9 @@ def extract_pdf_info(
3030
Return FEK header fields and parsed articles from a PDF.
3131
If include_metrics=True, merge basic text metrics at the top level.
3232
"""
33+
# Normalize once to a real Path (use a new local so mypy knows its type)
34+
p: Path = Path(pdf_path)
35+
3336
debug: bool = bool(kwargs.get("debug", False))
3437

3538
# NEW: accept an optional page from kwargs (from CLI)
@@ -88,7 +91,7 @@ def extract_pdf_info(
8891

8992
# 5) Compose record
9093
record: dict[str, Any] = {
91-
"filename": pdf_path.name,
94+
"filename": p.name,
9295
"path": str(pdf_path),
9396
"pages": count_pages(pdf_path),
9497
**header,

0 commit comments

Comments
 (0)