geonature.core.imports.actions¶
Classes¶
dict() -> new empty dictionary |
|
dict() -> new empty dictionary |
|
Module Contents¶
- class geonature.core.imports.actions.ImportStatisticsLabels[source]¶
Bases:
TypedDictdict() -> new empty dictionary dict(mapping) -> new dictionary initialized from a mapping object’s
(key, value) pairs
- dict(iterable) -> new dictionary initialized as if via:
d = {} for k, v in iterable:
d[k] = v
- dict(**kwargs) -> new dictionary initialized with the name=value pairs
in the keyword argument list. For example: dict(one=1, two=2)
- class geonature.core.imports.actions.ImportInputUrl[source]¶
Bases:
TypedDictdict() -> new empty dictionary dict(mapping) -> new dictionary initialized from a mapping object’s
(key, value) pairs
- dict(iterable) -> new dictionary initialized as if via:
d = {} for k, v in iterable:
d[k] = v
- dict(**kwargs) -> new dictionary initialized with the name=value pairs
in the keyword argument list. For example: dict(one=1, two=2)
- class geonature.core.imports.actions.ImportActions[source]¶
- static statistics_labels() List[ImportStatisticsLabels][source]¶
- Abstractmethod:
Return a list of key-value pairs describing the statistics of the import process.
Returns¶
- list[ImportStatisticsLabels]
A list of key-value pairs. Each key-value pair is a dictionary with two keys: “key” and “value”. The “key” key contains the label of the metric, the “value” key contains the value of the metric.
Raises¶
- NotImplementedError
If the method is not implemented in the child class.
- static process_fields(destination, fields)[source]¶
Process the given fields for the specified destination.
Used for monitoring to replace monitoring configuration variables (e.g. __MODULE.ID_LIST_TAXONOMY) in field parameters.
Parameters¶
- destinationAny
The destination object where fields are to be processed.
- fieldsList[BibFields]
A list of fields to be processed, originating from bib_fields.
- static preprocess_transient_data(imprt: geonature.core.imports.models.TImports, df) None[source]¶
Preprocess the transient data for the given import.
Parameters¶
- imprtTImports
The import object containing metadata about the import process.
- dfpandas.DataFrame
The DataFrame containing the transient data.
Notes¶
This method is responsible for performing any necessary data transformation on the transient data before it is controlled by check_transient_data imported into the destination database.
The method is optional and can be omitted if no preprocessing is needed.
- static check_transient_data(task, logger, imprt: geonature.core.imports.models.TImports) None[source]¶
- Abstractmethod:
Validate and process the transient data for the given import.
Parameters¶
- taskAny
The task object associated with the import process. Used by celery.
- loggerAny
Logger instance for logging information during validation. Used by celery.
- imprtTImports
The import object containing metadata about the import process.
Raises¶
- NotImplementedError
If the method is not implemented.
- static import_data_to_destination(imprt: geonature.core.imports.models.TImports) None[source]¶
- Abstractmethod:
Import data to the destination database for a given import.
Parameters¶
- imprtTImports
The import object containing information about the data to be imported.
Notes¶
The data to be imported is initially available in a transient table. This method processes and transfers the data from the transient table to the destination database.
- static remove_data_from_destination(imprt: geonature.core.imports.models.TImports) None[source]¶
Remove data from destination database for a given import.
Parameters¶
- imprtTImports
The import to remove data from.
Notes¶
This method is called when an import is deleted. It removes from the destination database all data that was created by the import.
If a child entity (e.g. Habitat) was created later on an imported parent entity (e.g. Station), deleting the imported entity will be refused !
- static report_plot(imprt: geonature.core.imports.models.TImports) bokeh.embed.standalone.StandaloneEmbedJson[source]¶
- Abstractmethod:
Generate the report plot for the given import. The plot must be realized using the Bokeh library. Plot must be return as JSON using the Bokeh json_item function.
Parameters¶
- imprtTImports
The import object containing information about the import process.
Returns¶
- plotStandaloneEmbedJson
The standalone embed json data for the report plot.
Notes¶
The report plot is a visualization of the imported data. It is used to provide a quick overview of the import data to the user.
- static compute_bounding_box(imprt: geonature.core.imports.models.TImports) None[source]¶
- Abstractmethod:
Calculate the bounding box for the imported data.
Parameters¶
- imprtTImports
The import object containing information about the import process.
Notes¶
This method calculates the smallest polygon (bounding box) that contains all the geographic data imported. The bounding box is to be displayed in the import report once all data has been validated.
- static is_observer_mapping_enabled() bool[source]¶
Check if observer mapping is a allowed for the current destination.
If not overridden, is_observer_mapping_enabled returns the value of ALLOW_USER_MAPPING in the configuration file, which is True by default.
Returns¶
- bool
True if observer mapping is enabled