Load data with a Python script in Bold Data Hub
The Bold Data Hub PythonScript connector runs a Python script to load data into Bold Reports®. A PythonScript is a .py file with Python instructions for tasks such as automation, data processing, or analysis.
Example Configuration
The following Bold Data Hub YAML template shows a complete PythonScript extractor configuration:
version: 1.0.1
encrypt_credentials: false
union_all_tables: true
add_dbname_column: false
use_snake_casing: true
plugins:
extractors:
- name: pyscript1
connectorname: PythonScript
schemaname:
config:
filePath: C:\BoldServices\app_data\elt\connectors\csvreaders.py
properties:
metadata:
select:How do I connect a Python script in Bold Data Hub?
You connect a Python script by creating a pipeline in Bold Data Hub, adding the PythonScript template, and uploading your .py file.
-
Click the
Data Hubicon on the Navigation Pane.
-
Click
Add Pipelineand enter a name for the new pipeline.
-
Select the newly created pipeline and add the
PythonScripttemplate.
-
In your Python script, make sure you have a
data frameobject. Add the following line after the dataframe object that is moved to tables usingBold ETL:pipeline.run(yourdataframename, table_name="yourtablename")Replace
yourdataframenamewith the dataframe name andyourtablenamewith the table name you want in your destination database. -
Click the Upload File button to upload your Python file.

-
Copy the file path and paste it into the filePath property.


-
Click Save and choose the destination to save the pipeline.

Creating a pipeline in Bold Data Hub automatically creates a data source in Bold Reports®. The Bold Reports® data source is a live data source to the destination database used in Bold Data Hub.

How do I schedule the PythonScript pipeline?
You schedule the PythonScript pipeline in Bold Data Hub from the schedules tab, or you run it on demand.
-
To configure interval-based scheduling, click the schedules tab, select the created pipeline, click the schedule icon, and configure the schedule.


-
For an on-demand refresh, click the
Run Nowbutton.
-
Check the schedule history with the history option and the logs.

-
Click Logs to see whether the run is completed and the data source is created in Bold Reports®.

-
Click the
Edit DataSourceoption to view the created tables.
Frequently asked questions
What must my Python script contain for Bold Data Hub?
Your script needs a data frame object, followed by a pipeline.run(yourdataframename, table_name="yourtablename") line that moves it to a table.
How does Bold Data Hub find my Python file?
Upload the file with the Upload File button, then copy its file path into the filePath property.