Data Sources
A data source describes how external data lands in a model. Every concrete
data-source config inherits from
DataSourceConfig
and is registered on a ConfigurationBuilder via
the matching add_* method.
Data source wrapper
DataSource — wraps a DataSourceConfig with metadata (display name,
visibility, behaviour flags).
- class DataSource(name, config)[source]
Wraps a
DataSourceConfigwith display metadata and behaviour flags.ConfigurationBuilder.add_*methods construct this wrapper for you and return it so you can chainset_*methods to customise behaviour.Hide this data source from the UI’s data menu.
- Return type:
- set_pre_optimise(pre_optimise)[source]
The data source will run automatically before optimisation has started.
- Return type:
- set_post_optimise(post_optimise)[source]
The data source will run automatically after optimisation has completed.
- Return type:
- set_notify_on_new_data(notify_on_new_data)[source]
Send a UI notification when new data arrives.
- Return type:
Base configuration
Abstract DataSourceConfig base class for typed data-source configurations.
Each concrete subclass corresponds to a DataSourceType value and is
serialised with a type discriminator key.
- class DataSourceConfig(track_changes_supported=False)[source]
Abstract base for typed data-source configurations.
- Parameters:
track_changes_supported (
bool) – Whether the data source supports change-detection between imports.
- abstract property type: DataSourceType
The
DataSourceTypediscriminator for this configuration.
DataSourceType discriminator enum for DataSourceConfig.
- class DataSourceType(*values)[source]
Identifies the kind of data source emitted in the JSON output.
- GEOLOCATION
Geocoding of address rows.
- DISTANCE_MATRIX
Computed distance/duration matrix.
- EXCEL_TRANSFORM
Spreadsheet-driven transform.
- DATA_STORE
External or internal data store.
- SET_FEATURES
Feature-flag toggles.
- BATCHED_DATA_SOURCE
Group of other data sources run together.
- RUN_REPORT
Run a report. Useful to batch reports with other data sources.
- MODEL_TRANSFORM
Secondary model used to transform data.
- RUN_EXTERNAL_MODEL
Run the model’s configured external evaluator.
- TRACK_CHANGES
Capture or revert a baseline.
- GEOLOCATION = 'GEOLOCATION'
- DISTANCE_MATRIX = 'DISTANCE_MATRIX'
- EXCEL_TRANSFORM = 'EXCEL_TRANSFORM'
- DATA_STORE = 'DATA_STORE'
- SET_FEATURES = 'SET_FEATURES'
- BATCHED_DATA_SOURCE = 'BATCHED_DATA_SOURCE'
- RUN_REPORT = 'RUN_REPORT'
- MODEL_TRANSFORM = 'MODEL_TRANSFORM'
- RUN_EXTERNAL_MODEL = 'RUN_EXTERNAL_MODEL'
- TRACK_CHANGES = 'TRACK_CHANGES'