Skip to main content

Fabric Fast Start is a set of tools to help you get started with Fabric.

Project description

Python Unit Tests

Fabric Fast Start

Fabric Fast Start is a set of tools to help you get started with Fabric, including the Azure Table Configuration Manager, a Python class designed to facilitate the management of configuration data stored in Azure Table Storage. This utility allows for the storage, retrieval, and resolution of configuration settings, making it easier to manage application settings across different environments.

Features

  • Initialize with either Azure Storage Account connection string or account name and key.
  • Store and retrieve configuration data by project and context.
  • Resolve configurations with support for environment variable substitution.

Requirements

  • Python 3.10+
  • Azure SDK for Python
  • PySpark (optional)
  • Delta Lake (optional)

Installation

Ensure you have the required Azure SDK packages installed:

pip install azure-core azure-data-tables

Usage

Initialization

You can initialize the AzureTableConfigManager in one of two ways:

  1. Using an Azure Storage Account connection string:
from fabric_fast_start.config import AzureTableConfigManager

connection_string = "Your Azure Storage Account connection string"
table_name = "ConfigurationTable"
config_manager = AzureTableConfigManager(table_name, connection_string=connection_string)
  1. Using an Azure Storage Account name and key:
from fabric_fast_start.config import AzureTableConfigManager

account_name = "Your Azure Storage Account name"
account_key = "Your Azure Storage Account key" # pragma: allowlist secret
table_name = "ConfigurationTable"
config_manager = AzureTableConfigManager.from_account_key(account_name, account_key, table_name)

Storing Configuration

To store a configuration for a specific project and context:

project_name = "MyProject"
context_name = "Development"
config_str = """
resources:
  keyvault: my-keyvault
database:
  host: {DB_HOST}
  username: {secret:db-username}
  password: {secret:db-password} # pragma: allowlist secret
"""
config_manager.store_config(project_name, context_name, config_str)

Retrieving and Resolving Configuration

Retrieve and resolve a configuration, optionally substituting environment variables:

# Without external variables
resolved_config = config_manager.resolve_config(project_name, context_name)

# With specified environment variables
env_vars = {"DB_HOST": "localhost"}
resolved_config = config_manager.resolve_config(project_name, context_name, env_vars)

# Automatically using environment variables from os.environ
resolved_config = config_manager.resolve_config(project_name, context_name, os.environ)

Contributing

Contributions are welcome! Please feel free to submit a pull request.

License

This project is licensed under the MIT License - see the LICENSE file for details.

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

fabric_fast_start-0.1.4.tar.gz (23.8 kB view details)

Uploaded Source

Built Distribution

fabric_fast_start-0.1.4-py3-none-any.whl (26.4 kB view details)

Uploaded Python 3

File details

Details for the file fabric_fast_start-0.1.4.tar.gz.

File metadata

  • Download URL: fabric_fast_start-0.1.4.tar.gz
  • Upload date:
  • Size: 23.8 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/5.1.1 CPython/3.12.4

File hashes

Hashes for fabric_fast_start-0.1.4.tar.gz
Algorithm Hash digest
SHA256 65f85c650a67918596c77e5a07d43dd3d0d68c0f5a0b4181c7d0ef1923dfc3b2
MD5 c06988de3871e213f37b32693f2879da
BLAKE2b-256 ce12800601150b051beb37621b632fc9f5aa0d1b22d4e54a4271974c409b9d81

See more details on using hashes here.

File details

Details for the file fabric_fast_start-0.1.4-py3-none-any.whl.

File metadata

File hashes

Hashes for fabric_fast_start-0.1.4-py3-none-any.whl
Algorithm Hash digest
SHA256 f64414923941c541b64385a564694d60507a6a8829fa90bca7d0586a879bdae3
MD5 144356fe304435808eacadd33d23d74e
BLAKE2b-256 dadf708dfcb729a7c4e3d5aaf7f3a0eebe6474cf11d7655a2c9fc368834af46f

See more details on using hashes here.

Supported by

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