This release is a pre-release and may not be stable for production use.
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 VSCode plugin) and GoodData Declarative API format.
Installation
pip install gooddata-code-convertors
Usage
YAML-to-Declarative functions accept parsed YAML dicts (e.g. from yaml.safe_load),
not raw YAML strings.
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)
Types: static (_types) vs. runtime-validating (pydantic_models)
Two parallel sets of Python types are generated from the same AAC JSON Schema:
gooddata_code_convertors._types—TypedDicts, re-exported at the package top level (from gooddata_code_convertors import Dashboard). Static typing only, zero runtime cost, zero validation.gooddata_code_convertors.pydantic_models— real Pydantic v2BaseModels (not re-exported at the top level, to avoid name collisions with_types— import from the submodule directly:from gooddata_code_convertors.pydantic_models import Dashboard). Use these when you need actual runtime validation of a payload, e.g.Dashboard.model_validate(payload).
Gotcha: shared string-pattern fields (e.g. every entity's id) are wrapped in their own
RootModel[str] class in pydantic_models rather than being plain str — access the value
via .root (e.g. dashboard.id.root). This is a deliberate trade-off: collapsing them into
plain str fields breaks import entirely, because pydantic-core's Rust regex engine can't
compile this schema's negative-lookahead patterns once collapsed. _types' TypedDicts are
unaffected (Dashboard["id"] is a plain str there, since TypedDict has no runtime pattern validation
to trip over).
Available Converters
YAML -> Declarative API
yaml_dataset_to_declarativeyaml_date_dataset_to_declarativeyaml_metric_to_declarativeyaml_visualisation_to_declarativeyaml_dashboard_to_declarativeyaml_plugin_to_declarativeyaml_attribute_hierarchy_to_declarative
Declarative API -> YAML
declarative_dataset_to_yamldeclarative_date_instance_to_yamldeclarative_metric_to_yamldeclarative_visualisation_to_yamldeclarative_dashboard_to_yamldeclarative_plugin_to_yamldeclarative_attribute_hierarchy_to_yaml
Utilities
build_afm_execution
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distributions
Built Distribution
Filter files by name, interpreter, ABI, and platform.
If you're not sure about the file name format, learn more about wheel file names.
Copy a direct link to the current filters
File details
Details for the file gooddata_code_convertors-11.53.0a6-py3-none-any.whl.
File metadata
- Download URL: gooddata_code_convertors-11.53.0a6-py3-none-any.whl
- Upload date:
- Size: 1.2 MB
- Tags: Python 3
- Uploaded using Trusted Publishing? Yes
- Uploaded via:
twine/7.0.0 CPython/3.13.14
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
876ba7e960d703a6500477ac86fbd1d32994887725c04680588fa8c49c97d9ea
|
|
| MD5 |
fefb9d946adb4e7aab14f2045be1cfab
|
|
| BLAKE2b-256 |
844369e51a7c8d46bf42dafd736fe5fdd6a3fdf1ca31e0ecc4b9f176260d427c
|
Provenance
The following attestation bundles were made for gooddata_code_convertors-11.53.0a6-py3-none-any.whl:
Publisher:
sdk-publish-pypi-convertors.yml on gooddata/gdc-ui
-
Statement:
-
Statement type:
https://in-toto.io/Statement/v1 -
Predicate type:
https://docs.pypi.org/attestations/publish/v1 -
Subject name:
gooddata_code_convertors-11.53.0a6-py3-none-any.whl -
Subject digest:
876ba7e960d703a6500477ac86fbd1d32994887725c04680588fa8c49c97d9ea - Sigstore transparency entry: 2511640348
- Sigstore integration time:
-
Permalink:
gooddata/gdc-ui@40e8eeeef2889634dcd2ab5ef2862292d451a733 -
Branch / Tag:
refs/heads/master - Owner: https://github.com/gooddata
-
Access:
private
-
Token Issuer:
https://token.actions.githubusercontent.com -
Runner Environment:
self-hosted -
Publication workflow:
sdk-publish-pypi-convertors.yml@40e8eeeef2889634dcd2ab5ef2862292d451a733 -
Trigger Event:
workflow_dispatch
-
Statement type: