Skip to content
This repository was archived by the owner on Apr 2, 2025. It is now read-only.

Commit 90b48d4

Browse files
committed
Typing fixes in utils.py
1 parent 7345162 commit 90b48d4

File tree

1 file changed

+5
-2
lines changed

1 file changed

+5
-2
lines changed

camelot/utils.py

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -11,6 +11,8 @@
1111
import warnings
1212
from itertools import groupby
1313
from operator import itemgetter
14+
from pathlib import Path
15+
from typing import Union
1416
from urllib.parse import urlparse as parse_url
1517
from urllib.parse import uses_netloc
1618
from urllib.parse import uses_params
@@ -32,6 +34,7 @@
3234
from pdfminer.pdfpage import PDFPage
3335
from pdfminer.pdfpage import PDFTextExtractionNotAllowed
3436
from pdfminer.pdfparser import PDFParser
37+
from pypdf._utils import StrByteType
3538

3639

3740
_VALID_URLS = set(uses_relative + uses_netloc + uses_params)
@@ -80,7 +83,7 @@ def random_string(length):
8083
return ret
8184

8285

83-
def download_url(url: str) -> str:
86+
def download_url(url: str) -> Union[StrByteType, Path]:
8487
"""Download file from specified URL.
8588
8689
Parameters
@@ -89,7 +92,7 @@ def download_url(url: str) -> str:
8992
9093
Returns
9194
-------
92-
filepath : str or unicode
95+
filepath : Union[StrByteType, Path]
9396
Temporary filepath.
9497
9598
"""

0 commit comments

Comments
 (0)