pipeline¶
load_config
¶
Load a pipeline config from a JSON or YAML file.
| PARAMETER | DESCRIPTION |
|---|---|
config_path
|
Path to the config file (.json, .yaml, or .yml).
TYPE:
|
| RETURNS | DESCRIPTION |
|---|---|
dict
|
Parsed config dict. |
| RAISES | DESCRIPTION |
|---|---|
FileNotFoundError
|
If the config file does not exist. |
ValueError
|
If the config is malformed. |
ImportError
|
If a YAML config is loaded without PyYAML installed. |
Source code in geopkgtoolkit/pipeline.py
run_pipeline
¶
run_pipeline(config: Union[str, Path, dict], report_path: Optional[Union[str, Path]] = None) -> dict
Run a pipeline and return the run report.
| PARAMETER | DESCRIPTION |
|---|---|
config
|
Path to a JSON/YAML config file, or an already-parsed config dict.
TYPE:
|
report_path
|
Optional path to write the run report as JSON. The CLI always writes a report (from the config 'report' key or a default next to the config file).
TYPE:
|
| RETURNS | DESCRIPTION |
|---|---|
dict
|
Report dict with per-step status, feature counts, errors, timing:: { "ok": True, "gpkg": "processed.gpkg", "steps": [ {"step": "import", "status": "ok", "features": 120, ...}, {"step": "clip", "status": "failed", "error": "..."}, ], "elapsed_s": 1.23, } |
Notes
With fail_fast: true (default false), execution stops at the
first failed step. With the default, all steps run regardless and
each failure is recorded in the report.
Source code in geopkgtoolkit/pipeline.py
226 227 228 229 230 231 232 233 234 235 236 237 238 239 240 241 242 243 244 245 246 247 248 249 250 251 252 253 254 255 256 257 258 259 260 261 262 263 264 265 266 267 268 269 270 271 272 273 274 275 276 277 278 279 280 281 282 283 284 285 286 287 288 289 290 291 292 293 294 295 296 297 298 299 300 301 302 303 304 305 306 307 308 309 310 311 | |
summarize_report
¶
Format a run report as a short human-readable summary.