Skip to main content

Azure python package for infinity team

Project description

Azure Package

Introduction

infi_azure is a comprehensive package that aims to simplify Azure operations by encapsulating core functionalities into three classes: AzureStorageAccount, AzureContainer, and AzureBlob. Additionally, it includes utility functions like azcopy to streamline the process of Azure actions.

Installation

Install the package via pipenv:

pipenv install infi_azure

Features

  • AzureStorageAccount: This class facilitates seamless interaction with Azure Storage Accounts
    by providing methods for connection, retrieving account details, checking account existence, and accessing
    the Blob Service Client.

  • AzureContainer: This class provides features for seamless interaction with Azure Storage Blob containers,
    including retrieving directories, generating Shared Access Signatures (SAS) tokens and URLs, checking container existence
    and deleting blobs within a specified directory.

  • AzureBlob: This class facilitates interactions with individual blobs within an Azure Storage Container,
    offering functionalities such as downloading blob content as bytes, checking blob existence,
    verifying if a directory is empty, creating an empty directory, and counting the number of blobs within a specified directory.

  • azcopy_action: This function utilizes AzCopy to copy the contents of a source folder to a specified destination
    container in Azure Blob Storage.

Usage Example

AzureStorageAccount

from azure_storage_account import AzureStorageAccount

# Replace 'your_connection_string_here' with your actual connection string
connection_string = "your_connection_string_here"

storage_account = AzureStorageAccount(connection_string)

# Check if the account exists
if storage_account.is_account_exist():
    print("Azure Storage Account exists.")
else:
    print("Azure Storage Account does not exist.")

AzureContainer

from azure_storage_account import AzureContainer

# Replace 'your_connection_string_here' with your actual connection string
connection_string = "your_connection_string_here"

# Replace 'your_container_name' with your actual container name
container_name = "your_container_name"

container = AzureContainer(connection_string, container_name)

# print all directories in container
print(container.get_all_blobs_in_container())

AzureBlob

from azure_storage_account import AzureBlob

# Replace 'your_connection_string_here' with your actual connection string
connection_string = "your_connection_string_here"

# Replace 'your_container_name' with your actual container name
container_name = "your_container_name"

# Replace 'your_blob_name' with your actual blob name
blob_name = "your_blob_name"

blob = AzureBlob(connection_string, container_name, blob_name)

# create empty directory
blob.create_empty_directory()

Azcopy

from azure_storage_account import azcopy_action

# Replace the parameters with your actual parameters
source = "your_source_container_url"
dest = "your_destination_container_url"
azcopy_path = "your_azcopy_path"
azcopy_action(azcopy_path, source, dest)

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

infi_azure-0.0.8.tar.gz (7.5 kB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

infi_azure-0.0.8-py3-none-any.whl (9.9 kB view details)

Uploaded Python 3

File details

Details for the file infi_azure-0.0.8.tar.gz.

File metadata

  • Download URL: infi_azure-0.0.8.tar.gz
  • Upload date:
  • Size: 7.5 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/4.0.2 CPython/3.11.5

File hashes

Hashes for infi_azure-0.0.8.tar.gz
Algorithm Hash digest
SHA256 8db958b95cd9ce54920dbf08ce14e33dac60fc6529b21cf83a8d63467a5a2ec6
MD5 d0c29f5bcdbb7cc319b08a097abf701e
BLAKE2b-256 d03db7758baa7419bb913b3242c72fd3e54ade2549c2b8bf06a56483f56ab45f

See more details on using hashes here.

File details

Details for the file infi_azure-0.0.8-py3-none-any.whl.

File metadata

  • Download URL: infi_azure-0.0.8-py3-none-any.whl
  • Upload date:
  • Size: 9.9 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/4.0.2 CPython/3.11.5

File hashes

Hashes for infi_azure-0.0.8-py3-none-any.whl
Algorithm Hash digest
SHA256 ee67685ecd0c5c4e1da37f10803b9ea20aa5abd07d797aea5bb96eb57f1bb215
MD5 ea2a8570d806ab094fbc4d170af710e4
BLAKE2b-256 e10126ebd54caa45ccb0ba0249ac096594e936ce7d18b44834f3bc03758d84c5

See more details on using hashes here.

Supported by

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