Translators
Translators
The Daco CLI can translate your OpenDPI port schemas into code and configuration for different platforms and languages. Each translator takes JSON Schema definitions and generates native type definitions or schema configurations.
Available Translators
| Translator | Output | Description |
|---|---|---|
| avro | .avsc | Apache Avro schema definitions |
| databrickspyspark | .py | Databricks PySpark StructType definitions |
| databricksscala | .scala | Databricks Scala case classes |
| databrickssql | .sql | Databricks SQL CREATE TABLE statements |
| gotypes | .go | Go struct definitions with JSON tags |
| protobuf | .proto | Protocol Buffers message definitions |
| pydantic | .py | Pydantic model classes |
| pyspark | .py | PySpark StructType definitions |
| python | .py | Python dataclass definitions |
| scala | .scala | Scala case classes |
| sparkscala | .scala | Spark Scala StructType definitions |
| sparksql | .sql | Spark SQL CREATE TABLE statements |
Usage
Use the daco ports translate command to generate code:
# Translate all ports to PySpark
daco ports translate --format pyspark
# Translate a specific port
daco ports translate daily_metrics --format gotypes
# Output to a specific directory
daco ports translate --format pydantic --output ./modelsEach translator page includes:
- Example input/output
- Supported JSON Schema features
- Type mappings and limitations