Add an URL scheme if missing: file:// for filepath-like input or http:// otherwise.
(url: str)
| 98 | |
| 99 | |
| 100 | def guess_scheme(url: str) -> str: |
| 101 | """Add an URL scheme if missing: file:// for filepath-like input or |
| 102 | http:// otherwise.""" |
| 103 | if _is_filesystem_path(url): |
| 104 | return any_to_uri(url) |
| 105 | return add_http_if_no_scheme(url) |
| 106 | |
| 107 | |
| 108 | def strip_url( |