Skip to main content

al-data-utils

Reusable Python utilities for data and automation workflows.

This repository contains independent utility modules for sync operations, git automation, SQL work, logging helpers, and MSSQL schema snapshot generation.

Install

pip install al-data-utils

Python 3.10+. Runtime dependencies (pyyaml, sqlalchemy, pandas, requests, msal, ...) are expected from the host environment, typically an Airflow image.

Modules

  • airflow_utils — Airflow Variable / connection helpers
  • azure_as_utils — Azure Analysis Services model refresh (REST + MSAL)
  • backup_utils — MSSQL schema snapshot to filesystem
  • config_utils — YAML config loading
  • files_sync_utils — folder inventory, sync plan, copy, retention
  • geo_utils — geo helpers
  • git_utils — git automation wrappers
  • logging_utils — unified logging
  • ones_api_utils — 1C/ОneS API client
  • sql_utils — UnifiedSQLClient (MSSQL / PostgreSQL / Snowflake via SQLAlchemy)
  • tg_utils — Telegram helpers

Examples

Runnable examples are available in the examples folder of the repository for the main utility groups. Use them as reference implementations for local scripts and automation jobs.

MSSQL Schema Snapshot

The snapshot tool exports SQL objects from MSSQL into a filesystem layout and syncs staging output to destination folders.

Current behavior highlights:

  • Supports single DB and multi-DB runs in one execution.
  • Always writes outputs into per-DB folders.
  • Uses staging first, then syncs to final output.
  • Supports cleanup of staging folders.
  • Supports sync log retention cleanup.
  • Supports include and exclude filters per object type.
  • Supports DataGrip template override files.

Output shape:

<MSSQL_OUT_DIR>/<DatabaseName>/schemas/<schema>/
	tables/
	views/
	routines/
	sequences/
	synonyms/

Snapshot Environment Variables

Core connection and output:

  • MSSQL_OUT_DIR
  • MSSQL_SERVER
  • MSSQL_DATABASE
  • MSSQL_DATABASES
  • MSSQL_AUTH_MODE
  • MSSQL_USER
  • MSSQL_PASSWORD
  • MSSQL_DRIVER

Snapshot behavior:

  • MSSQL_ENABLE_TABLE_DEFINITIONS
  • MSSQL_ENABLE_INDEXES
  • MSSQL_ENABLE_FOREIGN_KEYS
  • MSSQL_ENABLE_VIEWS
  • MSSQL_ENABLE_STORED_PROCEDURES
  • MSSQL_ENABLE_FUNCTIONS
  • MSSQL_ENABLE_SEQUENCES
  • MSSQL_ENABLE_SYNONYMS
  • MSSQL_CLEANUP_STAGING
  • MSSQL_SYNC_LOG_RETENTION_DAYS

Filters:

  • MSSQL_INCLUDE_SCHEMAS
  • MSSQL_EXCLUDE_SCHEMAS
  • MSSQL_INCLUDE_TABLES
  • MSSQL_EXCLUDE_TABLES
  • MSSQL_INCLUDE_VIEWS
  • MSSQL_EXCLUDE_VIEWS
  • MSSQL_INCLUDE_STORED_PROCEDURES
  • MSSQL_EXCLUDE_STORED_PROCEDURES
  • MSSQL_INCLUDE_FUNCTIONS
  • MSSQL_EXCLUDE_FUNCTIONS
  • MSSQL_INCLUDE_SEQUENCES
  • MSSQL_EXCLUDE_SEQUENCES
  • MSSQL_INCLUDE_SYNONYMS
  • MSSQL_EXCLUDE_SYNONYMS

Notes:

  • If MSSQL_DATABASES is set, it is treated as a comma-separated list.
  • If MSSQL_DATABASES is empty, MSSQL_DATABASE is used.
  • If MSSQL_DATABASE contains commas, it is also treated as a list for backward compatibility.

File Sync Utilities

files_sync_utils provides:

  • Inventory building
  • Plan generation
  • Copy and update execution
  • Extra destination cleanup rules
  • Activity CSV logging
  • Log retention cleanup

Git Utilities

git_utils wraps common git automation operations with consistent behavior and error handling.

Changelog

See CHANGELOG.md in the repository for release notes.

Metadata

Release files for al-data-utils 0.3.2

For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.

Source distribution (sdist)

Source distribution for al-data-utils 0.3.2
File Size Uploaded Provenance Actions
al_data_utils-0.3.2.tar.gz 51.6 kB Without provenance Details for al_data_utils-0.3.2.tar.gz

Built distribution (wheel)

Table of built distributions (wheels) for al-data-utils 0.3.2
File Interpreter ABI Platform Actions
al_data_utils-0.3.2-py3-none-any.whl Python 3 none any Details for al_data_utils-0.3.2-py3-none-any.whl

Total release size: 117.0 kB

Release files / al_data_utils-0.3.2.tar.gz

Download URL al_data_utils-0.3.2.tar.gz
Size 51.6 kB
Tags Source
SHA-256 checksum
How to use checksums
007906b059ab05892241a3a2ac6b88561c488372adadd49f1fa35ec25f374d3e
BLAKE2b-256 checksum
How to use checksums
815d5d4b92eca48c372ab8850560318ce2145f510993ed85c962e849b48b1196
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/7.0.0 CPython/3.13.14

Release files / al_data_utils-0.3.2-py3-none-any.whl

Download URL al_data_utils-0.3.2-py3-none-any.whl
Size 65.5 kB
Tags Python 3
SHA-256 checksum
How to use checksums
11b65003c5a0c136c1c11d571fcb90ac6bb79b124ac2ca46fc8c4968b02501d4
BLAKE2b-256 checksum
How to use checksums
9a0704a8c931d6ac5ba8e2b332339a2bf91d0cd61b07d73c3e24e7dc3ded748c
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/7.0.0 CPython/3.13.14

Security for al-data-utils 0.3.2

Provenance

Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.

No provenance found

None of the files in this release were uploaded with provenance metadata.

A note on package security

PyPI is a repository for distributing packages, not a service for auditing them. While third-party security researchers and our staff do their best to detect and remove malicious packages, PyPI cannot guarantee the quality, security or suitability of any given package.

To learn more about protecting yourself from malicious actors, visit our package security documentation.

Anthropic, PBC Visionary sponsor Bloomberg Visionary sponsor Hudson River Trading Visionary sponsor Meta Visionary sponsor NVIDIA Visionary sponsor Microsoft Sustainability sponsor Depot Continuous Integration AWS Cloud computing and Security Sponsor Datadog Monitoring Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page