Blob mapping utility for easy translation between azure urls and local paths
Project description
Blob mapping utility
When your code needs to access many mapped blobs as a mounted folder, the utility to make translation between blob urls and filepaths easier was made. It can be configured using the configuration json file.
Configuration file example:
{
"blob_mounting_configurations": [
{
"storage_account_name": "examplestagingstrgacc",
"storage_account_url": "https://examplestagingstrgacc.blob.core.windows.net/",
"container_name": "heightstore-example1-raw",
"mount_point": "/mnt/heightstore-example1-raw"
},
{
"storage_account_name": "examplestagingstrgacc",
"storage_account_url": "https://examplestagingstrgacc.blob.core.windows.net/",
"container_name": "heightstore-example2-raw",
"mount_point": "/mnt/heightstore-example2-raw"
},
{
"storage_account_name": "examplestagingstrgacc",
"storage_account_url": "https://examplestagingstrgacc.blob.core.windows.net/",
"container_name": "heightstore-example3-raw",
"mount_point": "/mnt/heightstore-example3-raw"
},
{
"storage_account_name": "examplestagingstrgacc",
"storage_account_url": "https://examplestagingstrgacc.blob.core.windows.net/",
"container_name": "example-container-raw",
"mount_point": "/mnt/example-container-raw"
}
]
}
How to use
from blob_mounting_helper_utility import BlobMappingUtility
json_config_file = "blob_mapping_config.json"
# read the file into a dictionary
with open(json_config_file) as json_file:
config = json.load(json_file)["blob_mounting_configurations"]
# create the utility object
blob_mapping_utility = BlobMappingUtility(config)
filepath1 = "/mnt/example-container-raw/cool_picture.png
blob_url = blob_mapping_utility.get_url_from_mounted_filepath(filepath1) # -> https://examplestagingstrgacc.blob.core.windows.net/example-container-raw/cool_picture.png
filepath2 = get_mounted_filepath_from_url(blob_url) # -> /mnt/example-container-raw/cool_picture.png
Project details
Release history Release notifications | RSS feed
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
Built Distribution
Close
Hashes for blob_mounting_helper_utility-1.0.10.tar.gz
Algorithm | Hash digest | |
---|---|---|
SHA256 | 962223910b1e815b40122bb8824bc3e48f2370d46c13fa300d7f8bb4907e6d1f |
|
MD5 | 8d27c45c0fe0efe1071a129db61c9b7c |
|
BLAKE2b-256 | d3409e2ea1e67935bd0afbea8057616b19da0b9372c34ac4a41f17468ca2f299 |
Close
Hashes for blob_mounting_helper_utility-1.0.10-py3-none-any.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 8e0083b610c9a4bee9896860cceff92ec94027fd036f157522df72f3beffc5a2 |
|
MD5 | b4f56e3511bcab04c5a6c1d0f88d0499 |
|
BLAKE2b-256 | 0d36cae2ac93709fcd36d7241ff3e81c0395cb6ac1a2f866ae8ccc3c05ceeb5e |