1.2.5. insupdel4stac.main module#
- class insupdel4stac.main.InsUpDel4STAC(stac_dir: str = '/home/docs/checkouts/readthedocs.org/user_builds/insupdel4stac/checkouts/latest/docs', action: str = 'Insert', table_details: list | None = None, default_catalog_name: str = 'catalog.json', service_type: str | None = 'pgstac', stacapi_properties: dict = {}, pgstac_properties: dict = {}, logger_properties: dict = {})[source]#
Bases:
objectThe current class serves as the primary implementation for performing Insert, Update, and Delete actions on STAC-Catalogs. The class gets the STAC directory and the action type, for initiating the subsequent process.
- Parameters:
stac_dir (str, optional) – The directory where the STAC Catalog is located. The default value is set to
os.getcwd().action (string, optional) – The type of action. The selection will be made from the options of
Insert,Update, andDelete. The default setting is set toInsert.table_details (Union[list, None], optional) – The permissible objects for input actions are a list of dictionaries, STAC-Collections, and STAC-Items. For further information about how to construct this argument, please refer to
table_details. The default value is set to None.default_catalog_name (str, optional) – It represents the default name of the STAC-catalog. The default value is set to “catalog.json`.
service_type (Union[str, None], optional) – It represents the type of service. The selection will be made from the
pgstacandstacapicomponents. For further information on this argument, please refer toservice_type. The default value is set topgstac.stacapi_properties (dict, optional) – The current dictionary provides definitions for STAC-API environments. To obtain additional information on the construction of
stacapi_properties, please refer tostacapi_properties. The default value is set to an empty dictionary, dict().pgstac_properties (dict, optional) – The current dictionary provides definitions for pgSTAC environments. To obtain additional information on the construction of
pgstac_properties, please refer topgstac_properties. The default value is set to an empty dictionary, dict().logger_properties (dict, optional) – The current dictionary provides definitions for logger properties. To obtain additional information on the construction of
logger_properties, please refer tologger_properties. The default value is set to an empty dictionary, dict().
- action: str#
The variable at present denotes the category of action. The decision will be taken from the alternatives of
Insert,Update, andDelete.
- dispatchCollectionActions(action: str, collections_list: list, service_type: str, table_details: list | None = None, loader: Loader | None = None, pgstacdb: PgstacDB | None = None, pgstac_properties: dict = {}, stacapi_properties: dict = {}, logger_properties: dict = {})[source]#
The provided function serves as a dispatcher, responsible for directing actions to their respective classes:
Deleter,Ingester, andUpdater.- Parameters:
action (str) – The type of action. The selection will be made from
Insert,Update, andDelete. The default setting is set toInsert.collections_list (list) – The permissible pySTAC Collection objects for input actions.
service_type (str) – It represents the type of service.
table_details (Union[list, None], optional) – The permissible objects for input actions
dictionaries (are a list of) –
STAC-Collections –
information (and STAC-Items. For further) –
argument (about how to construct this) –
to (please refer) –
:param
table_details. The default value is: :param set to None.: :param loader: Theloaderobject connector for pgSTAC. Thedefault value is set to None.
- Parameters:
pgstacdb (Union[object, None], optional) – The
pgstacdbobject connector for pgSTAC. The default value is set to None.pgstac_properties (dict, optional) – An environment dictionary for
pgSTAC. To obtain additional information on the construction ofpgstac_properties, please refer topgstac_properties. The default value is set to an empty dictionary, dict().stacapi_properties (dict, optional) – An environment dictionary for
STAC-API. To obtain additional information on the construction ofstacapi_properties, please refer tostacapi_properties. The default value is set to an empty dictionary, dict().logger_properties (dict, optional) – logger properties.
logger_properties.
- logger_properties: dict#
A dictionary of properties for logger. default is
None. You can look at keys inLoggerclass.
- pgstac_properties: dict#
The existing variable denotes the dictionary that furnishes definitions for STAC-API environments. The dictionary contains the following keys:
POSTGRES_HOST_READER (str): The host name of the database server for reading.
POSTGRES_HOST_WRITER (str): The host name of the database server for writing.
POSTGRES_PORT (str): The port number of the database server.
POSTGRES_USER (str): The username for the database server.
POSTGRES_PASSWORD (str): The password for the database server.
POSTGRES_DB (str): The name of the database.
PGUSER (str): The username for the database server.
PGPASSWORD (str): The password for the database server.
PGHOST (str): The host name of the database server.
PGDATABASE (str): The name of the database.
PgstacDB_dsn (str): The data source name (DSN) for the database connection.
PgstacDB_pool (object): The connection pool for the database.
PgstacDB_connection (object): The connection object for the database.
PgstacDB_commit_on_exit (bool): The boolean value that determines whether the
PgstacDB_debug (bool): The boolean value that determines whether the debug mode is enabled.
PgstacDB_use_queue (bool): The boolean value that determines whether the queue is used.
- service_type: str | None#
The variable now denotes the category of service. The pick will be made from the “pgstac” and “stacapi” components.
- pgstac (str): The execution of this operation is carried out on the pgSTAC
service using SQL-based commands by the pypgSTAC framework.
- stacapi (str): The execution of this procedure is carried out within the STAC-API
by utilizing POST, PUT, and DELETE requests to conduct the operations of inserting, updating, and deleting the STAC-Collections and STAC-Items, respectively. It is crucial to recognize that the implementation of the mentioned methods relies on the authorization and accessibility of the STAC-API services, together with the existence of authentication protocols to enable the execution of the designated tasks. To obtain additional details regarding the authentication procedure, please see the documentation for
stacapi_properties.
- stac_dir: str#
The variable at hand denotes the specific directory in which the STAC Catalog is presently situated.
- stacapi_properties: dict#
The existing variable denotes the dictionary that furnishes definitions for STAC-API environments. The dictionary contains the following keys:
stacapi_url (str): The URL of the STAC-API service.
- auth (dict, optional): The dictionary that contains the username and password
for the STAC-API service. e.g. {“username”: “username”, “password”: “password”}
timeout (int): The timeout value for the STAC-API service.
verify (bool): The boolean value that determines whether the verification is enabled.