Skip to content

Commit

Permalink
Typing fixes in utils.py
Browse files Browse the repository at this point in the history
  • Loading branch information
bosd committed Oct 19, 2024
1 parent 7345162 commit 90b48d4
Showing 1 changed file with 5 additions and 2 deletions.
7 changes: 5 additions & 2 deletions camelot/utils.py
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,8 @@
import warnings
from itertools import groupby
from operator import itemgetter
from pathlib import Path
from typing import Union
from urllib.parse import urlparse as parse_url
from urllib.parse import uses_netloc
from urllib.parse import uses_params
Expand All @@ -32,6 +34,7 @@
from pdfminer.pdfpage import PDFPage
from pdfminer.pdfpage import PDFTextExtractionNotAllowed
from pdfminer.pdfparser import PDFParser
from pypdf._utils import StrByteType


_VALID_URLS = set(uses_relative + uses_netloc + uses_params)
Expand Down Expand Up @@ -80,7 +83,7 @@ def random_string(length):
return ret


def download_url(url: str) -> str:
def download_url(url: str) -> Union[StrByteType, Path]:
"""Download file from specified URL.
Parameters
Expand All @@ -89,7 +92,7 @@ def download_url(url: str) -> str:
Returns
-------
filepath : str or unicode
filepath : Union[StrByteType, Path]
Temporary filepath.
"""
Expand Down

0 comments on commit 90b48d4

Please sign in to comment.