sec_interp.exporters package
- class sec_interp.exporters.AxesShpExporter(settings: dict[str, Any])[source]
Bases:
BaseExporterExports the profile axes to a Shapefile.
- class sec_interp.exporters.BaseExporter(settings: dict[str, Any])[source]
Bases:
ABCAbstract base class for all exporters.
This class defines the interface that all concrete exporters must implement. It follows the Template Method pattern, providing common initialization and validation logic while delegating format-specific export to subclasses.
- __init__(settings: dict[str, Any])[source]
Initialize the exporter with settings.
- Parameters:
settings – Dictionary containing export settings such as: - width: Output width in pixels - height: Output height in pixels - dpi: Dots per inch for resolution - background_color: Background color (QColor) - legend_renderer: Optional renderer for legend overlay
- abstractmethod export(output_path: Path, data: Any) bool[source]
Export data to file.
This method must be implemented by all concrete exporters.
- Parameters:
output_path – Destination file path
data – Data to export (format depends on exporter type)
- Returns:
True if export successful, False otherwise
- Return type:
bool
- get_setting(key: str, default: Any = None) Any[source]
Get a setting value with optional default.
- Parameters:
key – Setting key
default – Default value if key not found
- Returns:
Setting value or default
- abstractmethod get_supported_extensions() list[str][source]
Get list of supported file extensions.
- Returns:
List of supported extensions (e.g., [‘.png’, ‘.jpg’])
- validate_export_path(output_path: Path, base_dir: Path | None = None) tuple[bool, str][source]
Validate export path for security.
Uses secure path validation to prevent path traversal attacks.
- Parameters:
output_path – Path to validate
base_dir – Optional base directory to restrict exports to
- Returns:
(is_valid, error_message)
- Return type:
tuple
- class sec_interp.exporters.CSVExporter(settings: dict[str, Any])[source]
Bases:
BaseExporterExporter for CSV tabular format.
- class sec_interp.exporters.DrillholeInterval3DExporter(settings: dict[str, Any])[source]
Bases:
BaseExporterExports 3D drillhole intervals to a Shapefile.
- export(output_path: Any, data: dict[str, Any]) bool[source]
Export 3D drillhole intervals to a Shapefile.
- Parameters:
output_path – Path to the output Shapefile.
data – Dictionary containing ‘drillhole_data’ and ‘crs’. Can include ‘use_projected’ (bool).
- Returns:
True if export successful, False otherwise.
- Return type:
bool
- class sec_interp.exporters.DrillholeIntervalShpExporter(settings: dict[str, Any])[source]
Bases:
BaseExporterExports drillhole intervals to a Shapefile.
- class sec_interp.exporters.DrillholeTrace3DExporter(settings: dict[str, Any])[source]
Bases:
BaseExporterExports 3D drillhole traces to a Shapefile.
- export(output_path: Any, data: dict[str, Any]) bool[source]
Export 3D drillhole traces to a Shapefile.
- Parameters:
output_path – Path to the output Shapefile.
data – Dictionary containing ‘drillhole_data’ and ‘crs’. Can include ‘use_projected’ (bool).
- Returns:
True if export successful, False otherwise.
- Return type:
bool
- class sec_interp.exporters.DrillholeTraceShpExporter(settings: dict[str, Any])[source]
Bases:
BaseExporterExports drillhole traces to a Shapefile.
- class sec_interp.exporters.GeologyShpExporter(settings: dict[str, Any])[source]
Bases:
BaseExporterExports the geological profile to a Shapefile.
- class sec_interp.exporters.ImageExporter(settings: dict[str, Any])[source]
Bases:
BaseExporterExporter for raster image formats (PNG, JPG, JPEG).
- class sec_interp.exporters.Interpretation2DExporter(settings: dict[str, Any])[source]
Bases:
BaseExporterExports interpretations in 2D profile coordinates.
- __init__(settings: dict[str, Any])[source]
Initialize with settings.
- Parameters:
settings – Dictionary of configuration settings.
- export(output_path: Path, data: dict[str, Any]) bool[source]
Export interpretations to Shapefile.
- Parameters:
output_path – Path to the output Shapefile (.shp)
data – Dictionary containing: - interpretations: List of InterpretationPolygon objects
- Returns:
True if export successful, False otherwise
- Return type:
bool
- class sec_interp.exporters.Interpretation3DExporter(settings: dict[str, Any])[source]
Bases:
BaseExporterExporter for 3D Interpretation polygons (Shapefile 2.5D).
- class sec_interp.exporters.PDFExporter(settings: dict[str, Any])[source]
Bases:
BaseExporterExporter for PDF format.
- class sec_interp.exporters.ProfileLineShpExporter(settings: dict[str, Any])[source]
Bases:
BaseExporterExports the topographic profile line to a Shapefile.
- class sec_interp.exporters.SVGExporter(settings: dict[str, Any])[source]
Bases:
BaseExporterExporter for SVG vector format.
- class sec_interp.exporters.ShapefileExporter(settings: dict[str, Any])[source]
Bases:
BaseExporterExporter for Shapefile and GeoPackage formats.
- class sec_interp.exporters.StructureShpExporter(settings: dict[str, Any])[source]
Bases:
BaseExporterExports the structural profile to a Shapefile.
- sec_interp.exporters.get_exporter(extension: str, settings: dict)[source]
Get the appropriate exporter instance for the file extension.
- Parameters:
extension – File extension (e.g., ‘.png’, ‘.svg’)
settings – Export settings dictionary
- Returns:
Appropriate exporter instance
- Raises:
ValueError – If extension is not supported
Submodules
- sec_interp.exporters.base_exporter module
- sec_interp.exporters.csv_exporter module
- sec_interp.exporters.drillhole_3d_exporter module
- sec_interp.exporters.drillhole_exporters module
- sec_interp.exporters.image_exporter module
- sec_interp.exporters.interpretation_3d_exporter module
- sec_interp.exporters.interpretation_exporters module
- sec_interp.exporters.pdf_exporter module
- sec_interp.exporters.profile_exporters module
- sec_interp.exporters.shp_exporter module
- sec_interp.exporters.svg_exporter module