Packages
Export Copilot
Push semantic models to dbt, Snowflake, Looker, Tableau, and more
pramiti-export-copilot generates and delivers semantic model exports to downstream tools. It converts Pramiti knowledge models into the native formats of dbt, Snowflake, Databricks, Looker, and Tableau.
Install
pip install pramiti-export-copilotQuick Start
from pramiti_export_copilot import ExportCopilot, DeliveryConfig
from pramiti_export_copilot.backends import InMemoryBackend
from pramiti_export_copilot.delivery_targets import WebhookTarget
# Set up backend with model data
backend = InMemoryBackend()
backend.set_model_data("ws-1", {
"classes": [{"name": "Customer", "table": "customers", "columns": [...]}]
})
# Export to dbt YAML and deliver via webhook
copilot = ExportCopilot(backend)
result = copilot.export_and_deliver(
workspace_id="ws-1",
format="dbt",
config=DeliveryConfig(target=WebhookTarget(url="https://your-endpoint.com"))
)Supported Formats
| Format | Method | Output |
|---|---|---|
dbt | get_dbt_yaml() | dbt semantic layer YAML |
snowflake | get_snowflake_sql() | Snowflake SQL DDL + comments |
databricks | get_databricks_json() | Databricks Unity Catalog JSON |
looker | get_lookml() | LookML view definitions |
tableau | get_tableau_tds() | Tableau TDS connection files |
Delivery Targets
WebhookTarget
Delivers exports via HTTP POST:
target = WebhookTarget(url="https://your-endpoint.com", headers={"Authorization": "Bearer ..."})GitHubTarget
Creates a pull request with the export in a GitHub repository:
target = GitHubTarget(repo="org/repo", branch="main", token="ghp_...")GitLabTarget
Creates a merge request with the export in a GitLab repository:
target = GitLabTarget(project_id="123", branch="main", token="glpat-...")DbtCloudTarget
Experimental generic POST. dbt Cloud's Administrative API has no export-ingest route, so this target cannot push into dbt Cloud itself. endpoint_url is required and used verbatim.
target = DbtCloudTarget(
endpoint_url="https://ingest.example.com/exports",
service_token="tok",
account_id="123",
)API Reference
ExportCopilot
class ExportCopilot:
def __init__(self, backend: IModelDataBackend): ...
def export(self, workspace_id: str, format: str) -> str: ...
def export_and_deliver(self, workspace_id: str, format: str, config: DeliveryConfig) -> DeliveryResult: ...IModelDataBackend (Interface)
class IModelDataBackend(ABC):
def get_model_data(self, workspace_id: str) -> dict: ...
def get_dbt_yaml(self, workspace_id: str) -> str: ...
def get_snowflake_sql(self, workspace_id: str) -> str: ...
def get_databricks_json(self, workspace_id: str) -> str: ...
def get_lookml(self, workspace_id: str) -> str: ...
def get_tableau_tds(self, workspace_id: str) -> str: ...DeliveryResult
@dataclass
class DeliveryResult:
success: bool
format: str
target: str
content_hash: str # SHA-256 of delivered content
delivered_at: str
error: Optional[str]