Hello Community,
I have some tasks around components/elements automation in Dataminer so I started some digging/research and came across this piece that says Python is used for automation in Dataminer. I am curious to know if this runs in the background or something as I am aware automation in Dataminer as far as I know runs on C#.
Here is piece:
# Dataminer Automation Script
# Import necessary libraries
from dataminer import DataSource, DataTarget, DataIntegration
# Define data sources
source1 = DataSource('source1_connection')
source2 = DataSource('source2_connection')
# Define a data target
target = DataTarget('target_connection')
# Create a data integration job
data_integration_job = DataIntegration()
# Define data mapping and transformations
data_integration_job.map(source1.table('source_table1'), target.table('target_table1'))
data_integration_job.map(source2.table('source_table2'), target.table('target_table2'))
# Apply data transformations
data_integration_job.transform(
'target_table1.column1 = source_table1.column1 * 2',
'target_table2.column2 = source_table2.column2 + 10'
)
# Execute the data integration job
data_integration_job.execute()
# Log the completion of the script
print('Data integration job completed successfully.')
-----
# Dataminer Automation Script with JSON Configuration
import json
from dataminer import DataSource, DataTarget, DataIntegration
# Load data mapping configuration from a JSON file
with open('data_mapping_config.json', 'r') as config_file:
data_mapping_config = json.load(config_file)
# Define data sources and target
source = DataSource('source_connection')
target = DataTarget('target_connection')
# Create a data integration job
data_integration_job = DataIntegration()
# Apply data mappings from the JSON configuration
for mapping in data_mapping_config:
source_table = source.table(mapping['source_table'])
target_table = target.table(mapping['target_table'])
data_integration_job.map(source_table, target_table)
# Execute the data integration job
data_integration_job.execute()
# Log the completion of the script
print('Data integration job completed successfully.')
---
[
{
"source_table": "source_table1",
"target_table": "target_table1"
},
{
"source_table": "source_table2",
"target_table": "target_table2"
}
]
Automation scripts in DataMiner are always C#. There is no current Python support.
Also see this question: Dojo: Automation Script Environment - Python support not available (dataminer.services)
Many thanks Wouter! The embedded link has given me the desired clarification