Metadata-Version: 2.1
Name: fabric-fast-start
Version: 0.1.4
Summary: Fabric Fast Start is a set of tools to help you get started with Fabric.
Author-email: Serge Artishev <serge.artishev@fusion5.co.nz>
Maintainer-email: Serge Artishev <serge.artishev@fusion5.co.nz>
License: MIT License
        
        Copyright (c) 2024 Fusion5
        
        Permission is hereby granted, free of charge, to any person obtaining a copy
        of this software and associated documentation files (the "Software"), to deal
        in the Software without restriction, including without limitation the rights
        to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
        copies of the Software, and to permit persons to whom the Software is
        furnished to do so, subject to the following conditions:
        
        The above copyright notice and this permission notice shall be included in all
        copies or substantial portions of the Software.
        
        THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
        IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
        FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
        AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
        LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
        OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
        SOFTWARE.
        
Project-URL: Homepage, https://github.com/f5serge/fabric-fast-start
Project-URL: Issues, https://github.com/f5serge/fabric-fast-start/issues
Project-URL: Contributing, https://github.com/f5serge/fabric-fast-start/pulls
Project-URL: Releases, https://github.com/f5serge/fabric-fast-start/releases
Classifier: Development Status :: 3 - Alpha
Classifier: License :: OSI Approved :: MIT License
Classifier: Operating System :: OS Independent
Classifier: Programming Language :: Python :: 3
Classifier: Programming Language :: Python :: 3.10
Classifier: Programming Language :: Python :: 3.11
Classifier: Programming Language :: Python :: 3.12
Requires-Python: >=3.10
Description-Content-Type: text/markdown
License-File: LICENSE
Provides-Extra: dev
Requires-Dist: pre-commit; extra == "dev"
Requires-Dist: azure-core; extra == "dev"
Requires-Dist: azure-data-tables; extra == "dev"
Requires-Dist: dummy-notebookutils; extra == "dev"
Requires-Dist: ruff; extra == "dev"
Requires-Dist: black; extra == "dev"
Requires-Dist: mocker; extra == "dev"
Requires-Dist: mypy; extra == "dev"
Requires-Dist: types-PyYAML; extra == "dev"
Requires-Dist: types-requests; extra == "dev"
Requires-Dist: pandas-stubs; extra == "dev"
Requires-Dist: types-tqdm; extra == "dev"
Requires-Dist: pyspark==3.5.1; extra == "dev"
Requires-Dist: delta-spark==3.2.0; extra == "dev"
Requires-Dist: semantic-link==0.7.7; extra == "dev"
Requires-Dist: jwt==1.3.1; extra == "dev"
Provides-Extra: test
Requires-Dist: azure-core; extra == "test"
Requires-Dist: azure-data-tables; extra == "test"
Requires-Dist: azure-storage-blob; extra == "test"
Requires-Dist: dummy-notebookutils; extra == "test"
Requires-Dist: pyyaml; extra == "test"
Requires-Dist: pytest; extra == "test"
Requires-Dist: pytest-cov; extra == "test"
Requires-Dist: mocker; extra == "test"
Requires-Dist: pytest-mock; extra == "test"
Requires-Dist: types-PyYAML; extra == "test"
Requires-Dist: types-requests; extra == "test"
Requires-Dist: pandas-stubs; extra == "test"
Requires-Dist: types-tqdm; extra == "test"
Requires-Dist: pyspark==3.5.1; extra == "test"
Requires-Dist: delta-spark==3.2.0; extra == "test"
Requires-Dist: semantic-link==0.7.7; extra == "test"
Requires-Dist: jwt==1.3.1; extra == "test"

[![Python Unit Tests](https://github.com/f5serge/fabric-fast-start/actions/workflows/python-tests.yaml/badge.svg)](https://github.com/f5serge/fabric-fast-start/actions/workflows/python-tests.yaml)

# 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:

```bash
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:**

```python
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:**

```python
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:

```python
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:

```python
# 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.
