{ "cells": [ { "cell_type": "markdown", "id": "97c08de2-c219-4379-9e9e-6706a0da0b1e", "metadata": {}, "source": [ "INSUPDEL4STAC\n", "==================\n", "\n", "In this section, we present a set of illustrative examples that demonstrate the process of working with INSUPDEL4STAC.\n", "\n", "
\n", "Warning\n", "\n", "To execute INSUPDEL4STAC, it is necessary to have a running STAC-FastAPI or pgSTAC, and thereafter perform the ingestion, deletion, or updating of your STAC-Metadata.\n", "
\n", "\n", "First we need to install the package\n" ] }, { "cell_type": "code", "execution_count": null, "id": "92dddfbc-b2ed-4702-8574-acaca36f58e6", "metadata": {}, "outputs": [], "source": [ "pip install insupdel4stac" ] }, { "cell_type": "markdown", "id": "7259dbdc-f4f3-45f0-8480-635a9c140c61", "metadata": {}, "source": [ "In this example, our objective is to ingest a STAC-Catalog using STAC-API and pgSTAC." ] }, { "cell_type": "code", "execution_count": null, "id": "dcd2ca35-9f57-475c-8012-638363643d4b", "metadata": {}, "outputs": [], "source": [ "from insupdel4stac import INSUPDEL4STAC\n", "\n", "InsUpDel4STAC(\n", " stac_dir=\"unittestdata/stac/\",\n", " service_type=\"pgstac\",\n", " action=\"Insert\",\n", " logger_properties={\"logger_handler\": \"StreamHandler\"},\n", ")\n", "\n", "InsUpDel4STAC(\n", " stac_dir=\"unittestdata/stac/\",\n", " service_type=\"stacapi\",\n", " action=\"Insert\",\n", " logger_properties={\"logger_handler\": \"StreamHandler\"},\n", ")" ] }, { "cell_type": "markdown", "id": "bc65c9eb-0017-41d4-83e6-154e600a9c3a", "metadata": {}, "source": [ "In this example, our objective is to update the STAC-Catalog that we have already ingested using the STAC-API and pgSTAC." ] }, { "cell_type": "code", "execution_count": null, "id": "cd2c36d1-025b-4714-b917-49945f466719", "metadata": {}, "outputs": [], "source": [ "from insupdel4stac import INSUPDEL4STAC\n", "\n", "InsUpDel4STAC(\n", " stac_dir=\"unittestdata/stac/\",\n", " service_type=\"pgstac\",\n", " action=\"Update\",\n", " logger_properties={\"logger_handler\": \"StreamHandler\"},\n", ")\n", "\n", "InsUpDel4STAC(\n", " stac_dir=\"unittestdata/stac/\",\n", " service_type=\"stacapi\",\n", " action=\"Update\",\n", " logger_properties={\"logger_handler\": \"StreamHandler\"},\n", ")" ] }, { "cell_type": "markdown", "id": "2c3f6f1c-8556-470f-b271-a4c45a5d400a", "metadata": {}, "source": [ "In this example, our objective is to remove the STAC-Catalog that we previously updated using the STAC-API and pgSTAC." ] }, { "cell_type": "code", "execution_count": null, "id": "b3a9e62e-c99f-4d3d-8b9a-21bc3bf4f161", "metadata": {}, "outputs": [], "source": [ "from insupdel4stac import INSUPDEL4STAC\n", "\n", "InsUpDel4STAC(\n", " stac_dir=\"unittestdata/stac/\",\n", " service_type=\"pgstac\",\n", " action=\"Delete\",\n", " logger_properties={\"logger_handler\": \"StreamHandler\"},\n", ")\n", "\n", "InsUpDel4STAC(\n", " stac_dir=\"unittestdata/stac/\",\n", " service_type=\"stacapi\",\n", " action=\"Delete\",\n", " logger_properties={\"logger_handler\": \"StreamHandler\"},\n", ")" ] } ], "metadata": { "kernelspec": { "display_name": "Python 3 (ipykernel)", "language": "python", "name": "python3" }, "language_info": { "codemirror_mode": { "name": "ipython", "version": 3 }, "file_extension": ".py", "mimetype": "text/x-python", "name": "python", "nbconvert_exporter": "python", "pygments_lexer": "ipython3", "version": "3.12.0" } }, "nbformat": 4, "nbformat_minor": 5 }