We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
1 parent 305e05b commit 8172137Copy full SHA for 8172137
1 file changed
src/neuromaps_prime/fetcher.py
@@ -2,6 +2,7 @@
2
3
from pathlib import Path
4
from typing import Literal
5
+from urllib.parse import urlparse
6
7
from neuromaps_prime.remote import OSFStorage
8
@@ -15,8 +16,15 @@ def id_storage(uri: str) -> Literal["osf"] | None:
15
16
Returns:
17
String indicating type of storage (one of 'osf')
18
"""
- if "osf.io" in uri:
19
- return "osf"
+
20
+ def _find_host(storage: str, host: str) -> bool:
21
+ return storage == host or host.endswith(storage)
22
23
+ host = urlparse(uri).hostname
24
+ if host is not None:
25
+ host = host.lower()
26
+ if _find_host(storage="osf.io", host=host):
27
+ return "osf"
28
return None
29
30
0 commit comments