Skip to main content

A package to implement a singleton for azure data storage gen2

Project description


AZ Data Lake

Instalación

pip3 install azdatalakefacade

Manual de uso

  1. Variables de Entorno
Variable Tipo de dato
AZ_DATA_LAKE_STRING_CONNECTION string
AZ_CONTAINNER_CLI string
  1. Funciones:

    • upload_file(blob_name, data): Este método permite subir un archivo a azure data storage gen2.
    • upsert_data_to_table(table_name, data): Este método permite subir datos a una tabla de azure data storage gen2.
    • send_data_to_queue(queue_name, data): Este método permite subir datos a una cola de azure data storage gen2.
    • get_messages_from_queue(queue_name, max_messages): Este método permite obtener datos de una cola de azure data storage gen2.
    • get_table_data(table_name, partition_key, row_key): Este método permite obtener datos de una tabla de azure data storage gen2.
    • get_all_table_data(table_name, partition_key, row_key): Este método permite obtener una tabla de azure data storage gen2.
    • get_data_by_partition(table_name, partition_key, row_key): Este método permite obtener los datos de una particion de una tabla de azure data storage gen2.
    • get_csv(blob_name): Este método permite obtener datos de un csv de azure data storage gen2 y retorna un dataframe.
  2. Ejemplos de Uso

from azdatalakefacade.singleton import AzDataLakeSingleton

# Crear instancia del singleton
az = AzDataLakeSingleton()

# Consultar datos de un csv
content = az.get_csv(blob_name="mis_datos.csv")
print(content)

# Subir un archivo
az.upload_file("local.csv", az.read_file_as_bytes("local.csv"))

# Consulta datos de una tabla
data = az.get_table_data("unitest3", "480217418839", 23)
print(data)

# actualizar datos de una tabla
az.upsert_data_to_table(table_name="unitest3", data=data)

# obtener tabla completa
data = az.get_all_table_data("alarmassolis")
print("tabla obtenidos: ")
print(data)


# obtener particion de tabla
data = az.get_data_by_partition("alarmassolis", "1298491919449258694_2025_01")
print("tabla obtenidos: ")
print(data)

By: Alan Medina ⚙️

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

azdatalakefacade-1.0.2.tar.gz (5.2 kB view details)

Uploaded Source

Built Distribution

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

azdatalakefacade-1.0.2-py3-none-any.whl (8.9 kB view details)

Uploaded Python 3

File details

Details for the file azdatalakefacade-1.0.2.tar.gz.

File metadata

  • Download URL: azdatalakefacade-1.0.2.tar.gz
  • Upload date:
  • Size: 5.2 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.0.1 CPython/3.8.10

File hashes

Hashes for azdatalakefacade-1.0.2.tar.gz
Algorithm Hash digest
SHA256 f01a40a487d8dde3b47972941e6cfcf36b802445d5ff953b85ed7c3340e05751
MD5 bb5cb1d8c5d48001a1f922ed44bf591a
BLAKE2b-256 4ca4138843524d609b7309d43cad966d8a50dfa10544df2f9096df4356760eec

See more details on using hashes here.

File details

Details for the file azdatalakefacade-1.0.2-py3-none-any.whl.

File metadata

File hashes

Hashes for azdatalakefacade-1.0.2-py3-none-any.whl
Algorithm Hash digest
SHA256 c88e83c12c2a74fcefbd65efebaf8e9b236a00baab5a3f9b6c1324b7ffb03f50
MD5 ab18941585029f8ff954bedb4bae5afb
BLAKE2b-256 ebea02280e1bb75dde3f4b442a4b2eac516ee295848d8a49db39eacebb9af02e

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