universal_pathlib
universal_pathlib copied to clipboard
How to get the storage account name with AzurePath?
Version:
- Python 3.10.13
- universal_pathlib==0.2.6
The following
UPath('abfs://container_name@storage_account_name.dfs.core.windows.net/')
return AzurePath('abfs://container_name/')
How to get the AzurePath with storage account?
it's parsed as your account name and available in storage_options
>>> import upath
>>> p = upath.UPath("abfs://container_name@storage_account_name.dfs.core.windows.net/")
>>> p
AzurePath('abfs://container_name/')
>>> p.protocol
'abfs'
>>> p.path
'container_name/'
>>> p.storage_options
mappingproxy({'account_name': 'storage_account_name'})