MCPcopy Index your code
hub / github.com/python-telegram-bot/python-telegram-bot / is_local_file

Function is_local_file

src/telegram/_utils/files.py:81–95  ·  view source on GitHub ↗

Checks if a given string is a file on local system. Args: obj (:obj:`str`): The string to check.

(obj: FilePathInput | None)

Source from the content-addressed store, hash-verified

79
80
81def is_local_file(obj: FilePathInput | None) -> bool:
82 """
83 Checks if a given string is a file on local system.
84
85 Args:
86 obj (:obj:`str`): The string to check.
87 """
88 if obj is None:
89 return False
90
91 path = Path(obj)
92 try:
93 return path.is_file()
94 except Exception:
95 return False
96
97
98def parse_file_input( # pylint: disable=too-many-return-statements

Callers 5

get_fileMethod · 0.90
download_to_driveMethod · 0.90
download_to_memoryMethod · 0.90
download_as_bytearrayMethod · 0.90
parse_file_inputFunction · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected

Used in the wild real call sites across dependent graphs

searching dependent graphs…