Skip to main content

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


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

blob_mounting_helper_utility-1.0.9.tar.gz (3.6 kB view details)

Uploaded Source

Built Distribution

blob_mounting_helper_utility-1.0.9-py3-none-any.whl (4.0 kB view details)

Uploaded Python 3

File details

Details for the file blob_mounting_helper_utility-1.0.9.tar.gz.

File metadata

File hashes

Hashes for blob_mounting_helper_utility-1.0.9.tar.gz
Algorithm Hash digest
SHA256 ff7fb0a6d4f8bae1091b66f5b1f66b4a156f1c8ad880519c36671ca1ab4fd398
MD5 7e85ab3f4c1a1807222bed01b238ae3c
BLAKE2b-256 f32f7243bb1c2c55e12447dc6572629abc0fdd93b948bd6ef9dd65d6ca454a5d

See more details on using hashes here.

File details

Details for the file blob_mounting_helper_utility-1.0.9-py3-none-any.whl.

File metadata

File hashes

Hashes for blob_mounting_helper_utility-1.0.9-py3-none-any.whl
Algorithm Hash digest
SHA256 b39e17f223e7a4c1b5b6008d2d48f88f11100f1ce3159fee32af68313d35cec6
MD5 9c33394a82ede7a38f2af563236d2b81
BLAKE2b-256 6417c16a191a69e7375fd32315833d040612b1be29d44b15cddeda88e3ec4a30

See more details on using hashes here.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Fastly CDN Google Download Analytics Pingdom Monitoring Sentry Error logging StatusPage Status page