Metadata-Version: 2.4
Name: gooddata-code-convertors
Version: 11.28.0
Summary: GoodData AAC YAML / Declarative API code converters (WASM-powered)
Project-URL: Repository, https://github.com/gooddata/gooddata-ui-sdk
Project-URL: Source, https://github.com/gooddata/gooddata-ui-sdk/tree/master/libs/sdk-code-convertors/python
License: Copyright (c) 2020-2026 GoodData Corporation
        
        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.
License-File: LICENSE
Classifier: License :: OSI Approved :: MIT License
Classifier: Programming Language :: Python :: 3
Requires-Python: >=3.10
Requires-Dist: wasmtime<31.0.0,>=25.0.0
Description-Content-Type: text/markdown

# gooddata-code-convertors

GoodData AAC YAML / Declarative API code converters, powered by WebAssembly.

Provides bidirectional conversion between AAC YAML format (used by the
[gdc-analytics-as-code](https://marketplace.visualstudio.com/items?itemName=GoodData.gooddata-code) VSCode plugin)
and GoodData Declarative API format.

## Installation

```bash
pip install gooddata-code-convertors
```

## Usage

YAML-to-Declarative functions accept **parsed YAML dicts** (e.g. from `yaml.safe_load`),
not raw YAML strings.

```python
import yaml
from gooddata_code_convertors import yaml_metric_to_declarative, declarative_metric_to_yaml

# AAC YAML -> Declarative API
with open("metrics/revenue.yaml") as f:
    parsed = yaml.safe_load(f)
declarative = yaml_metric_to_declarative(parsed)

# Declarative API -> AAC YAML
yaml_result = declarative_metric_to_yaml(declarative)
```

## Available Converters

### YAML -> Declarative API

- `yaml_dataset_to_declarative`
- `yaml_date_dataset_to_declarative`
- `yaml_metric_to_declarative`
- `yaml_visualisation_to_declarative`
- `yaml_dashboard_to_declarative`
- `yaml_plugin_to_declarative`
- `yaml_attribute_hierarchy_to_declarative`

### Declarative API -> YAML

- `declarative_dataset_to_yaml`
- `declarative_date_instance_to_yaml`
- `declarative_metric_to_yaml`
- `declarative_visualisation_to_yaml`
- `declarative_dashboard_to_yaml`
- `declarative_plugin_to_yaml`
- `declarative_attribute_hierarchy_to_yaml`

### Utilities

- `build_afm_execution`
